Corporate Headquarters:
Copyright © 2003–2005 Cisco Systems, Inc. All rights reserved.
Cisco Systems, Inc., 170 West Tasman Drive, San Jose, CA 95134-1706 USA
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
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, page 2
Restrictions for DHCP Release and Renew CLI in EXEC Mode, page 2
Information About DHCP Release and Renew CLI in EXEC Mode, page 2
How to Enable DHCP Release and Renew CLI in EXEC Mode, page 3
Configuration Examples for DHCP Release and Renew CLI in EXEC Mode, page 4
Additional References, page 5
Command Reference, page 6
Release Modification
12.3(4)T This feature was introduced.
12.2(27)SBA This feature was integrated into Cisco IOS Release 12.2(27)SBA.
DHCP Release and Renew CLI in EXEC Mode
Prerequisites for DHCP Release and Renew CLI in EXEC Mode
2
Cisco IOS Release: Multiple releases (see the Feature History table)
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, page 2
DHCP Release and Renew CLI Operation, page 2
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
DHCP Release and Renew CLI in EXEC Mode
How to Enable DHCP Release and Renew CLI in EXEC Mode
3
Cisco IOS Release: Multiple releases (see the Feature History table)
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, page 3 (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
DHCP Release and Renew CLI in EXEC Mode
Configuration Examples for DHCP Release and Renew CLI in EXEC Mode
4
Cisco IOS Release: Multiple releases (see the Feature History table)
DETAILED STEPS
Configuration Examples for DHCP Release and Renew CLI in
EXEC Mode
This section contains the following configuration examples:
Release DHCP Lease: Example, page 4
Renew DHCP Lease: Example, page 4
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
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.
DHCP Release and Renew CLI in EXEC Mode
Additional References
5
Cisco IOS Release: Multiple releases (see the Feature History table)
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
Standards
MIBs
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 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 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
DHCP Release and Renew CLI in EXEC Mode
Command Reference
6
Cisco IOS Release: Multiple releases (see the Feature History table)
RFCs
Technical Assistance
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
RFCs Title
RFC 2131 Dynamic Host Configuration Protocol
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
DHCP Release and Renew CLI in EXEC Mode
release dhcp
7
Cisco IOS Release: Multiple releases (see the Feature History table)
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
Command Modes User EXEC
Privileged EXEC
Command History
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
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.
Release Modification
12.3(4)T This command was introduced.
12.2(27)SBA This command was integrated into Cisco IOS Release 12.2(27)SBA.
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.
DHCP Release and Renew CLI in EXEC Mode
release dhcp
8
Cisco IOS Release: Multiple releases (see the Feature History table)
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.
Command Description
DHCP Release and Renew CLI in EXEC Mode
renew dhcp
9
Cisco IOS Release: Multiple releases (see the Feature History table)
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
Command Modes User EXEC
Privileged EXEC
Command History
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
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.
Release Modification
12.3(4)T This command was introduced.
12.2(27)SBA This command was integrated into Cisco IOS Release 12.2(27)SBA.
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.
DHCP Release and Renew CLI in EXEC Mode
renew dhcp
10
Cisco IOS Release: Multiple releases (see the Feature History table)
Copyright © 2003–2005 Cisco Systems, Inc. All rights reserved.
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.
Command Description
C
CVP, the Cisco logo, and Welcome to the Human Network are trademarks of Cisco Systems, Inc.; Changing the Way We Work, Live, Play, and Learn is
a
service mark of Cisco Systems, Inc.; and Access Registrar, Aironet, Catalyst, CCDA, CCDP, CCIE, CCIP, CCNA, CCNP, CCSP, Cisco, the Cisco
C
ertified Internetwork Expert logo, Cisco IOS, Cisco Press, Cisco Systems, Cisco Systems Capital, the Cisco Systems logo, Cisco Unity,
E
nterprise/Solver, EtherChannel, EtherFast, EtherSwitch, Fast Step, Follow Me Browsing, FormShare, GigaDrive, HomeLink, Internet Quotient, IOS,
i
Phone, IP/TV, iQ Expertise, the iQ logo, iQ Net Readiness Scorecard, iQuick Study, LightStream, Linksys, MeetingPlace, MGX, Networkers,
N
etworking Academy, Network Registrar, PIX, ProConnect, ScriptShare, SMARTnet, StackWise, The Fastest Way to Increase Your Internet Quotient,
a
nd TransPath are registered trademarks of Cisco Systems, Inc. and/or its affiliates in the United States and certain other countries.
A
ll other trademarks mentioned in this document or Website are the property of their respective owners. The use of the word partner does not imply a
p
artnership relationship between Cisco and any other company. (0711R)