The documentation set for this product strives to use bias-free language. For the purposes of this documentation set, bias-free is defined as language that does not imply discrimination based on age, disability, gender, racial identity, ethnic identity, sexual orientation, socioeconomic status, and intersectionality. Exceptions may be present in the documentation due to language that is hardcoded in the user interfaces of the product software, language used based on RFP documentation, or language that is used by a referenced third-party product. Learn more about how Cisco is using Inclusive Language.
Cisco IOS XE Dynamic Host Configuration Protocol (DHCP) client software 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. This module describes the concepts and tasks needed to configure the Cisco IOS XE DHCP client.
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.
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.
The configurable dynamic host configuration protocol client functionality allows a 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 the DHCP message. The DHCP client provides flexibility by allowing the following options to be configured for a DHCP client:
Option 12—This option specifies the name of the client. The name may or may not be qualified with the local domain.
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.
Option 120—This option is used to specify a 32-bit (binary) IPv4 address to be used by the Session Initiation Protocol (SIP) client to locate a SIP server.
Note | If a request includes both static routes and classless static routes, the client uses only the classless static routes. If the DHCP server returns both a classless static route option and a router option, the DHCP client ignores the router option. |
Option 125—This option is used by DHCP clients and servers to exchange vendor-specific information.
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.
1.
enable
2.
configure terminal
3.
interface
type number
4.
ip address dhcp
5.
end
6.
debug dhcp detail
7.
debug ip dhcp server packets
To verify the configuration, you can use the debug dhcp detail EXEC 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.
The figure below shows a simple network diagram of a DHCP client on an Ethernet LAN.
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 GigabitEthernet 0/0/0:
interface GigabitEthernet 0/0/0 ip address dhcp
This configuration allows the DHCP client to acquire an IP address from the DHCP server through GigabitEthernet interface 0/0/0.
The following example shows how to customize the DHCP client configuration with various options on GigabitEthernet 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 sanfran no ip dhcp client request tftp-server-address ip address dhcp
Related Topic |
Document Title |
---|---|
Cisco IOS commands |
|
DHCP commands: complete command syntax, command modes, command history, defaults, usage guidelines, and examples. |
|
DHCP conceptual information |
“DHCP Overview” module |
DHCP server configuration |
“Configuring the Cisco IOS XE DHCP Server” module |
DHCP server on-demand address pools |
“Configuring the DHCP Server On-Demand Address Pool Manager” module |
DHCP relay agent configuration |
“Configuring the Cisco IOS XE DHCP Relay Agent” module |
DHCP advanced features |
“Configuring DHCP Services for Accounting and Security” module |
RFCs |
Title |
---|---|
RFC 2131 |
Dynamic Host Configuration Protocol |
RFC 2132 |
DHCP Options and BOOTP Vendor Extensions |
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. |
Description |
Link |
---|---|
The Cisco Support website provides extensive online resources, including documentation and tools for troubleshooting and resolving technical issues with Cisco products and technologies. To receive security and technical information about your products, you can subscribe to various services, such as the Product Alert Tool (accessed from Field Notices), the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS) Feeds. Access to most tools on the Cisco Support website requires a Cisco.com user ID and password. |