- DHCP Overview
- Configuring the Cisco IOS DHCP Server
- DHCP Server MIB
- Configuring the DHCP Server On-Demand Address Pool Manager
- DHCP Server RADIUS Proxy
- Configuring the Cisco IOS DHCP Relay Agent
- Configuring the Cisco IOS DHCP Client
- DHCP Option 82 Configurable Circuit ID and Remote ID
- Configuring DHCP Services for Accounting and Security
- Configuring DHCP Enhancements for Edge Session Management
- ISSU and SSO--DHCP High Availability Features
- DHCP Option 82 Support for Routed Bridge Encapsulation
- DHCPv6 Bulk-Lease Query
- DHCPv6 Relay and Server - MPLS VPN Support
- DHCPv6 Relay Source Configuration
- IPv6 Access Services: DHCPv6 Relay Agent
- DHCPv6 Server Stateless Autoconfiguration
- IPv6 Access Services: Stateless DHCPv6
- DHCPv6 Repackaging
- IPv6 Access Services: DHCPv6 Prefix Delegation
- DHCPv6 Guard
- Finding Feature Information
- Restrictions for the DHCP Client
- Information About the DHCP Client
- How to Configure the DHCP Client
- Configuring FORCERENEW Message Handling
- Example: Configuring the DHCP Client
- Example: Configuring the Configurable DHCP Client
- Example: Configuring an ATM Primary Interface Using aal5snap Encapsulation and Inverse ARP
- Example: Configuring an ATM Point-to-Point Subinterface Using aal5snap Encapsulation
- Example: Configuring an ATM Point-to-Point Subinterface Using aal5nlpid Encapsulation
- Example: Configuring an ATM Point-to-Point Subinterface Using aal5mux PPP Encapsulation
- Examples: Releasing a DHCP Lease
- Examples: Renewing a DHCP Lease
DHCP Client
The Cisco Dynamic Host Configuration Protocol (DHCP) Client feature allows a Cisco device to act as a host requesting configuration parameters, such as an IP address, from a DHCP server.
Finding Feature Information
Your software release may not support all the features documented in this module. For the latest caveats and feature information, see Bug Search Tool and the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the feature information table at the end of this module.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Restrictions for the DHCP Client
The DHCP client can be configured on Ethernet interfaces.
Information About the DHCP Client
- DHCP Client Operation
- Configurable DHCP Client Overview
- DHCP Client on WAN Interfaces Overview
- DHCP Client FORCERENEW Message Overview
DHCP Client Operation
The Dynamic Host Configuration Protocol (DHCP) provides a framework for passing configuration information to hosts on a TCP/IP network. A DHCP client is an Internet host using DHCP to obtain configuration parameters such as an IP address. The figure below shows the basic steps that occur when a DHCP client requests an IP address from a DHCP server. The client, Host A, sends a DHCPDISCOVER broadcast message to locate a DHCP server. A DHCP server offers configuration parameters (such as an IP address, a MAC address, a domain name, and a lease for the IP address) to the client in a DHCPOFFER unicast message.
Figure 1 | DHCP Request for an IP Address from a DHCP Server |
A DHCP client may receive offers from multiple DHCP servers and can accept any one of the offers; however, the client usually accepts the first offer it receives. The offer from the DHCP server is not a guarantee that the IP address will be allocated to the client; however, the server usually reserves the address until the client has had a chance to formally request the address.
The client returns a formal request for the offered IP address to the DHCP server in a DHCPREQUEST broadcast message. The DHCP server confirms that the IP address has been allocated to the client by returning a DHCPACK unicast message to the client.
Configurable DHCP Client Overview
The configurable DHCP client functionality allows a Dynamic Host Configuration Protocol (DHCP) client to use a user-specified client identifier, class identifier, or suggested lease time when requesting an address from a DHCP server.
Configuration parameters and other control information are carried in tagged data items that are stored in the options field of a DHCP message. The DHCP client provides flexibility by allowing the following options to be configured for a DHCP client:
- Option 33--This option is used to configure a list of static routes in the client.
- Option 51--This option is used in a client request (DHCPDISCOVER or DHCPREQUEST) to allow the client to request a lease time for the IP address.
- Option 55--This option allows the DHCP client to request certain options from the DHCP server. The ip dhcp client request command allows the system administrator to turn off some of the requested options, thus removing them from the request list.
- Option 60--This option allows the user to configure the vendor class identifier string to use in the DHCP interaction.
- Option 61--This option is used by DHCP clients to specify their unique identifier. DHCP servers use this value to index their database of address bindings. This value is expected to be unique for all clients in an administrative domain.
DHCP Client on WAN Interfaces Overview
The DHCP Client on WAN Interfaces feature allows a Dynamic Host Configuration Protocol (DHCP) client to acquire an IP address over PPP over ATM (PPPoA) and certain ATM interfaces. By using DHCP rather than the IP Control Protocol (IPCP), a DHCP client can acquire other useful information such as Domain Name System (DNS) addresses, the DNS default domain name, and the default route.
The configuration of PPPoA and Classical IP and Address Resolution Protocol (ARP) over ATM already allows for a broadcast capability over the interface when you enter the broadcast command on the ATM interface. The DHCP Client on WAN Interfaces feature removes existing restrictions on what types of interfaces are allowed to send DHCP packets (previously, dialer interfaces were not allowed). This feature also ensures that DHCP RELEASE messages are sent out the interface before a connection is allowed to be broken.
DHCP Client FORCERENEW Message Overview
The Cisco DHCP Client FORCERENEW Message feature provides entity authentication and message authentication, in accordance with RFC 3118, by which Dynamic Host Configuration Protocol (DHCP) clients and servers authenticate the identity of other DHCP entities and verify that the content of a DHCP message has not been changed during delivery through the network.
The message authentication mechanism allows servers to determine whether a request for DHCP information comes from a client that is authorized to use the network. It also allows clients to verify that a DHCP server can be trusted to provide valid configuration.
The Cisco DHCP Client FORCERENEW Message feature requires authentication, and all client-server exchanges must be authenticated. The ip dhcp client authentication mode and key chain commands must be configured.
When the client gets a FORCERENEW message, the client does the following:
-
Authenticates the message according to the authentication mode specified in the ip dhcp client authentication mode command. The Cisco DHCP Client FORCERENEW Message feature supports both token-based and message digest algorithm 5 (MD5)-based authentication:
- Token-based authentication is useful only for basic protection against inadvertently instantiated DHCP servers. Tokens are transmitted in plain text; they provide weak authentication and do not provide message authentication.
- MD5-based authentication provides better message and entity authentication because it contains a single-use value generated by the source as a message authentication code.
- Changes its state to RENEW.
- Tries to renew its lease according to normal DHCP procedures.
The client discards any multicast FORCERENEW message or message that fails authentication.
How to Configure the DHCP Client
- Configuring the DHCP Client
- Forcing a Release or Renewal of a DHCP Lease for a DHCP Client
- Configuring FORCERENEW Message Handling
Configuring the DHCP Client
Configuring the DHCP Client
Cisco devices running Cisco software include the Dynamic Host Configuration Protocol (DHCP) server and relay agent software, which are enabled by default. Your device can act as both the DHCP client and the DHCP server. Use the ip address dhcp command to obtain IP address information for the configured interface.
DETAILED STEPS
Troubleshooting Tips
To verify the configuration, you can use the debug dhcp detail command to display the DHCP packets that were sent and received. To display the server side of the DHCP interaction, use the debug ip dhcp server packets command.
Forcing a Release or Renewal of a DHCP Lease for a DHCP Client
Perform this task to force a release or renewal of a DHCP lease for a DHCP client.
Forcing a release or renewal of a DHCP lease for a DHCP client provides the ability to perform two independent operations from the command-line interface (CLI) in EXEC mode:
- Immediately release a DHCP lease for a DHCP client.
- Force a DHCP renewal of a lease for a DHCP client.
This functionality 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
Overview of Releasing a DHCP Lease
The release dhcp command starts the process to immediately release a Dynamic Host Configuration Protocol (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 device is rebooted, the ip address dhcp command acquires a DHCP address for the interface.
Overview of Renewing a DHCP Lease
The renew dhcp command advances the Dynamic Host Configuration Protocol (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.
Configuring FORCERENEW Message Handling
Perform this task to specify the type of authentication to be used in Dynamic Host Configuration Protocol (DHCP) messages on the interface, specify the key chain to be used in authenticating a request, and enable FORCERENEW message handling on the DHCP client when authentication is enabled.
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
|
Example: Device(config)# interface Ethernet 1 |
Configures an interface type and enters interface configuration mode. |
|
Example: Device(config-if)# ip dhcp client authentication key-chain dhcp1 |
Specifies the key chain to be used in authenticating a request. |
|
Example: Device(config-if)# ip dhcp client authentication mode md5 |
Specifies the type of authentication to be used in DHCP messages on the interface. |
|
Example: Device(config-if)# exit |
Exits interface configuration mode. |
|
Example: Device(config)# key chain dhcp1 |
Defines an authentication key chain needed to enable authentication and enters key-chain configuration mode. |
|
Example: Device(config-keychain)# key 1234 |
Identifies an authentication key on a key chain and enters key-chain key configuration mode. |
|
Example: Device(config-keychain-key)# key-string secret |
Specifies the authentication string for a key. |
|
Example: Device(config-keychain-key)# exit |
Returns to key-chain configuration mode. |
|
Example: Device(config-keychain)# exit |
Returns to global configuration mode. |
|
Example: Device(config)# ip dhcp-client forcerenew |
Enables DHCP FORCERENEW message handling on the DHCP client. |
|
Example: Device(config)# end |
(Optional) Returns to privileged EXEC mode. |
Configuration Examples for the DHCP Client
- Example: Configuring the DHCP Client
- Example: Configuring the Configurable DHCP Client
- Example: Configuring an ATM Primary Interface Using aal5snap Encapsulation and Inverse ARP
- Example: Configuring an ATM Point-to-Point Subinterface Using aal5snap Encapsulation
- Example: Configuring an ATM Point-to-Point Subinterface Using aal5nlpid Encapsulation
- Example: Configuring an ATM Point-to-Point Subinterface Using aal5mux PPP Encapsulation
- Examples: Releasing a DHCP Lease
- Examples: Renewing a DHCP Lease
Example: Configuring the DHCP Client
The figure below shows a simple network diagram of a Dynamic Host Configuration Protocol (DHCP) client on an Ethernet LAN.
Figure 2 | Topology Showing a DHCP Client with a Gigabit Ethernet Interface |
On the DHCP server, the configuration is as follows:
ip dhcp pool 1 network 10.1.1.0 255.255.255.0 lease 1 6
On the DHCP client, the configuration is as follows on interface E2:
interface GigabitEthernet 0/0/0 ip address dhcp
This configuration allows the DHCP client to acquire an IP address from the DHCP server through Gigabit Ethernet interface 0/0/0.
Example: Configuring the Configurable DHCP Client
The following example shows how to customize the Dynamic Host Configuration Protocol (DHCP) client configuration with various configurable DHCP client options on Gigabit Ethernet interface 0/0/1:
interface GigabitEthernet 0/0/1 ip dhcp client client-id ascii my-test1 ip dhcp client class-id my-class-id ip dhcp client lease 0 1 0 ip dhcp client hostname host1 no ip dhcp client request tftp-server-address ip address dhcp
Example: Configuring an ATM Primary Interface Using aal5snap Encapsulation and Inverse ARP
In the following example, the protocol ip 255.255.255.255 broadcast command is needed because there must be an ATM map entry to recognize the broadcast flag on the permanent virtual circuit (PVC). You can use any ATM map entry. The protocol ip inarp configuration is needed so that the ATM Inverse Address Resolution Protocol (ARP) can operate on the interface so that the system can be pinged once an address is assigned by the Dynamic Host Configuration Protocol (DHCP).
interface atm 0 ip address dhcp pvc 1/100 encapsulation aal5snap broadcast protocol ip 255.255.255.255 broadcast protocol ip inarp
Example: Configuring an ATM Point-to-Point Subinterface Using aal5snap Encapsulation
The following example shows an ATM point-to-point subinterface configuration using aal5snap encapsulation:
interface atm 0.1 point-to-point ip address dhcp pvc 1/100 encapsulation aal5snap broadcast
Example: Configuring an ATM Point-to-Point Subinterface Using aal5nlpid Encapsulation
The following example shows an ATM point-to-point subinterface configuration using aal5nlpid encapsulation:
interface atm 0.1 point-to-point ip address dhcp pvc 1/100 encapsulation aal5nlpid broadcast
Example: Configuring an ATM Point-to-Point Subinterface Using aal5mux PPP Encapsulation
The following example shows an ATM point-to-point subinterface configuration using aal5mux PPP encapsulation:
interface atm 0.1 point-to-point pvc 1/100 encapsulation aal5mux ppp broadcast ! interface virtual-template1 ip address dhcp
Examples: Releasing a DHCP Lease
In the following example, a Dynamic Host Configuration Protocol (DHCP) release is performed on an interface that was originally assigned an IP address by the DHCP server:
Device# 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:
Device# 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:
Device# release dhcp
Incomplete command.
Examples: Renewing a DHCP Lease
In the following example, a Dynamic Host Configuration Protocol (DHCP) lease is renewed on an interface that was originally assigned an IP address by the DHCP server:
Device# 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:
Device# 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:
Device# renew dhcp
Incomplete command.
Additional References
Related Documents
Related Topic | Document Title |
---|---|
Cisco IOS commands |
|
DHCP commands |
|
DHCP conceptual information |
"DHCP Overview" module in the IP Addressing: DHCP Configuration Guide |
RFCs
RFCs | Title |
---|---|
RFC 2131 |
Dynamic Host Configuration Protocol |
RFC 2132 |
DHCP Options and BOOTP Vendor Extensions |
Technical Assistance
Description | Link |
---|---|
The Cisco Support and Documentation website provides online resources to download documentation, software, and tools. Use these resources to install and configure the software and to troubleshoot and resolve technical issues with Cisco products and technologies. Access to most tools on the Cisco Support and Documentation website requires a Cisco.com user ID and password. |
Feature Information for the DHCP Client
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 1 | Feature Information for the DHCP Client |
Feature Name |
Releases |
Feature Information |
---|---|---|
Configurable DHCP Client |
12.2(28)SB 12.3(8)T 15.3(1)S |
The Configurable DHCP Client feature provides the flexibility to include various configuration options for the DHCP client. A DHCP client is defined as an Internet host using DHCP to obtain configuration parameters such as an IP address. The following commands were introduced: ip dhcp client class-id, ip dhcp client client-id, ip dhcp client hostname, ip dhcp client lease, ip dhcp client request. |
DHCP Client Option 121 |
15.2(4)S |
The DHCP Client Option 121 feature allows you to configure classless static routes by specifying classless network destinations in the routes. No commands were introduced or modified by this feature. |
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.