Guest

Cisco IOS Software Releases 12.3 T

DHCP Release and Renew CLI in EXEC Mode

Table Of Contents

DHCP Release and Renew CLI in EXEC Mode

Contents

Prerequisites for DHCP Release and Renew CLI in EXEC Mode

Restrictions for DHCP Release and Renew CLI in EXEC Mode

Information About DHCP Release and Renew CLI in EXEC Mode

Benefits of the DHCP Release and Renew CLI in EXEC Mode Feature

DHCP Release and Renew CLI Operation

How to Enable DHCP Release and Renew CLI in EXEC Mode

Enabling DHCP Release and Renew CLI in EXEC Mode

Configuration Examples for DHCP Release and Renew CLI in EXEC Mode

Release DHCP Lease: Example

Renew DHCP Lease: Example

Additional References

Related Documents  

Standards

MIBs

RFCs 

Technical Assistance

Command Reference

release dhcp

renew dhcp


DHCP Release and Renew CLI in EXEC Mode


The DHCP Release and Renew CLI in EXEC Mode feature provides the ability to perform two independent operations from the command-line interface (CLI):

Immediately release a Dynamic Host Configuration Protocol (DHCP) lease for a DHCP client.

Force a DHCP renewal of a lease for a DHCP client.

Feature History for the DHCP Release and Renew CLI in EXEC Mode Feature

Release
Modification

12.3(4)T

This feature was introduced.


Finding Support Information for Platforms and Cisco IOS Software Images

Use Cisco Feature Navigator to find information about platform support and Cisco IOS software image support. Access Cisco Feature Navigator at http://www.cisco.com/go/fn. You must have an account on Cisco.com. If you do not have an account or have forgotten your username or password, click Cancel at the login dialog box and follow the instructions that appear.

Contents

Prerequisites for DHCP Release and Renew CLI in EXEC Mode

Restrictions for DHCP Release and Renew CLI in EXEC Mode

Information About DHCP Release and Renew CLI in EXEC Mode

How to Enable DHCP Release and Renew CLI in EXEC Mode

Configuration Examples for DHCP Release and Renew CLI in EXEC Mode

Additional References

Command Reference

Prerequisites for DHCP Release and Renew CLI in EXEC Mode

Before you use the DHCP Release and Renew CLI in EXEC Mode feature, the DHCP client must be assigned an IP address by the DHCP server.

Restrictions for DHCP Release and Renew CLI in EXEC Mode

If the DHCP client is not assigned an IP address by the DHCP server, the DHCP Release and Renew CLI commands will fail.

Information About DHCP Release and Renew CLI in EXEC Mode

Before using the DHCP Release and Renew CLI in EXEC Mode feature, you should understand the following concepts:

Benefits of the DHCP Release and Renew CLI in EXEC Mode Feature

DHCP Release and Renew CLI Operation

Benefits of the DHCP Release and Renew CLI in EXEC Mode Feature

The DHCP Release and Renew CLI in EXEC Mode feature provides the ability to perform two independent operations from the CLI:

Immediately release a Dynamic Host Configuration Protocol (DHCP) lease for a DHCP client.

Force a DHCP renewal of a lease for a DHCP client.

The DHCP Release and Renew CLI in EXEC Mode feature provides the following benefits:

Eliminates the need to go into the configuration mode to reconfigure the router to release or renew a DHCP lease.

Simplifies the release and renewal of a DHCP lease.

Reduces the amount of time spent performing DHCP IP release and renewal configuration tasks.

DHCP Release and Renew CLI Operation

Release a DHCP Lease

The release dhcp command starts the process to immediately release a DHCP lease for the specified interface. After the lease is released, the interface address is deconfigured. The release dhcp command does not deconfigure the ip address dhcp command specified in the configuration file for the interface. During a write memory or show running configuration file action, or if the router is rebooted, the ip address dhcp command executes to acquire a DHCP address for the interface.

The original IP address for the interface must be assigned by the DHCP server. If the interface is not assigned an IP address by the DHCP server, the release dhcp command fails and displays the following error message:

Interface does not have a DHCP originated address


Renew a DHCP Lease

The renew dhcp command advances the DHCP lease timer to the next stage, at which point one of the following occurs:

If the lease is currently in a BOUND state, the lease is advanced to the RENEW state and a DHCP RENEW request is sent.

If the lease is currently in a RENEW state, the timer is advanced to the REBIND state and a DHCP REBIND request is sent.

If there is no response to the RENEW request, the interface remains in the RENEW state. In this case, the lease timer will advance to the REBIND state and subsequently send a REBIND request.

If a NAK response is sent in response to the RENEW request, the interface is deconfigured.

The original IP address for the interface must be assigned by the DHCP server. If the interface is not assigned an IP address by the DHCP server, the renew dhcp command fails and displays the following error message:

Interface does not have a DHCP originated address


How to Enable DHCP Release and Renew CLI in EXEC Mode

This section contains the following procedure:

Enabling DHCP Release and Renew CLI in EXEC Mode (required)

Enabling DHCP Release and Renew CLI in EXEC Mode

To enable the DHCP Release and Renew CLI in EXEC Mode feature, perform the following steps:

SUMMARY STEPS

1. enable

2. release dhcp type number

3. renew dhcp type number

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

release dhcp type number

Example:

Router# release dhcp ethernet 3/1

Performs an immediate release of the DHCP lease for the interface and deconfigures the IP address for the interface.

Step 3 

renew dhcp type number

Example:

Router# renew dhcp ethernet 3/1

Forces the DHCP timer to advance to the next stage, at which point a subsequent action is taken: a DHCP REQUEST packet is sent to renew or rebind the lease.

Configuration Examples for DHCP Release and Renew CLI in EXEC Mode

This section contains the following configuration examples:

Release DHCP Lease: Example

Renew DHCP Lease: Example

Release DHCP Lease: Example

In the following example, a DHCP release is performed on an interface that was originally assigned an IP address by the DHCP server.

Router# release dhcp ethernet 3/1

In the following example, an attempt is made to release the DHCP lease on an interface that was not originally assigned an IP address by the DHCP server.

Router# release dhcp ethernet 3/1

Interface does not have a DHCP originated address


In the following example, the release dhcp command is executed without specifying the type and number arguments.

Router# release dhcp

Incomplete command.


Renew DHCP Lease: Example

In the following example, the DHCP lease is renewed on an interface that was originally assigned an IP address by the DHCP server.

Router# renew dhcp ethernet 3/1

In the following example, an attempt is made to renew the DHCP lease on an interface that was not originally assigned an IP address by the DHCP server.

Router# renew dhcp ethernet 3/1

Interface does not have a DHCP originated address


In the following example, the renew dhcp command is executed without specifying the type and number arguments.

Router# renew dhcp

Incomplete command.


Additional References

This section provides references related to the DHCP Release and Renew CLI in EXEC Mode feature.

Related Documents

Related Topic
Document Title

Information about managing configuration files

Cisco IOS Configuration Fundamentals and Network Management Command Reference, Release 12.3 T

Commands for showing interface statistics

Cisco IOS Interface and Hardware Component Command Reference, Release 12.3 T

DHCP commands

Cisco IOS IP Command Reference, Volume 1 of 4: Addressing and Services, Release 12.3 T


  

Standards

Standards
Title

No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.

 

MIBs

MIBs
MIBs Link

No new or modified MIBs are supported by this feature, and support for existing MIBs has not been modified by this feature.

To locate and download MIBs for selected platforms, Cisco IOS releases, and feature sets, use Cisco MIB Locator found at the following URL:

http://www.cisco.com/go/mibs


RFCs

RFCs
Title

RFC 2131

Dynamic Host Configuration Protocol


 

Technical Assistance

Description
Link

Technical Assistance Center (TAC) home page, containing 30,000 pages of searchable technical content, including links to products, technologies, solutions, technical tips, and tools. Registered Cisco.com users can log in from this page to access even more content.

http://www.cisco.com/public/support/tac/home.shtml


Command Reference

This section documents new commands. All other commands used with this feature are documented in the Cisco IOS Release 12.3 T command reference publications.

release dhcp

renew dhcp

release dhcp

To perform an immediate release of a Dynamic Host Configuration Protocol (DHCP) lease for an interface, use the release dhcp command in user EXEC or privileged EXEC mode.

release dhcp type number

Syntax Description

type

Interface type. For more information, use the question mark (?) online help function.

number

Interface or subinterface number. For more information about the numbering syntax for your networking device, use the question mark (?) online help function.


Command Modes

User EXEC
Privileged EXEC

Command History

Release
Modification

12.3(4)T

This command was introduced.


Usage Guidelines

The release dhcp command immediately releases the DHCP lease on the interface specified by the type and number arguments. If the router interface was not assigned a DHCP IP address by the DHCP server, the release dhcp command fails and displays the following error message:

Interface does not have a DHCP originated address


This command does not have a no form.

Examples

The following example shows how to release a DHCP lease for an interface.

Router# release dhcp ethernet 3/1

Related Commands

Command
Description

ip address dhcp

Specifies that the Ethernet interface acquires an IP address through DHCP.

lease

Configures the duration of the lease for an IP address that is assigned from a Cisco IOS DHCP server to a DHCP client.

renew dhcp

Forces the renewal of the DHCP lease for the specified interface.

show dhcp lease

Displays the DHCP addresses leased from a server.

show interface

Displays statistics for all interfaces configured on the router or access server.

show ip dhcp binding

Displays address bindings on the Cisco IOS DHCP server.

show ip interface

Displays a summary of an interface's IP information and status.

show running-config

Displays the contents of the currently running configuration file or the configuration for a specific interface.

show startup-config

Displays the contents of the configuration file that will be used at the next system startup.


renew dhcp

To perform an immediate renewal of a Dynamic Host Configuration Protocol (DHCP) lease for an interface, use the renew dhcp command in user EXEC or privileged EXEC mode.

renew dhcp type number

Syntax Description

type

Interface type. For more information, use the question mark (?) online help function.

number

Interface or subinterface number. For more information about the numbering syntax for your networking device, use the question mark (?) online help function.


Command Modes

User EXEC
Privileged EXEC

Command History

Release
Modification

12.3(4)T

This command was introduced.


Usage Guidelines

The renew dhcp command immediately renews the DHCP lease for the interface specified by the type and number arguments. If the router interface was not assigned an IP address by the DHCP server, the renew dhcp command fails and displays the following error message:

Interface does not have a DHCP originated address


This command does not have a no form.

Examples

The following example shows how to renew a DHCP lease for an interface.

Router# renew dhcp Ethernet 3/1

Related Commands

Command
Description

ip address dhcp

Specifies that the Ethernet interface acquires an IP address through DHCP.

lease

Configures the duration of the lease for an IP address that is assigned from a Cisco IOS DHCP server to a DHCP client.

release dhcp

Releases the DHCP lease on the specified interface.

show dhcp lease

Displays the DHCP addresses leased from a server.

show interface

Displays statistics for all interfaces configured on the router or access server.

show ip dhcp binding

Displays address bindings on the Cisco IOS DHCP server.

show ip interface

Displays a summary of an interface's IP information and status.

show running-config

Displays the contents of the currently running configuration file or the configuration for a specific interface.

show startup-config

Displays the contents of the configuration file that will be used at the next system startup.