![]() |
IP Addressing: DHCP Configuration Guide, Cisco IOS Release 12.4T
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Configuring the Cisco IOS DHCP Client
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contents
Configuring the Cisco IOS DHCP ClientLast Updated: April 30, 2012
Cisco IOS 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 DHCP client. It includes information on the Cisco DHCP FORCERENEW feature, which provides entity authentication and message authentication. Finding Feature InformationYour software release may not support all the features documented in this module. For the latest feature information and caveats, see 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 document. 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 Configuring the DHCP ClientThe DHCP client can be configured on Ethernet interfaces and on PPP over ATM (PPPoA) and certain ATM interfaces. The DHCP client works with ATM point-to-point interfaces and will accept any encapsulation type. For ATM multipoint interfaces, the DHCP client is supported using only the aal5snap encapsulation type combined with Inverse Address Resolution Protocol (ARP). Inverse ARP, which builds an ATM map entry, is necessary to send unicast packets to the server (or relay agent) on the other end of the connection. Inverse ARP is supported only for the aal5snap encapsulation type. For multipoint interfaces, an IP address can be acquired using other encapsulation types because broadcast packets are used. However, unicast packets to the other end will fail because there is no ATM map entry and thus DHCP renewals and releases also fail. Information About the DHCP ClientDHCP Client OperationDHCP 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. Additionally, 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. DHCP Client OverviewThe configurable DHCP 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:
DHCP Client on WAN InterfacesThe DHCP client on WAN interfaces allows a DHCP client to acquire an IP address over 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 ARP over ATM already allows for a broadcast capability over the interface (using the broadcast keyword on the ATM interface). Most changes in this feature are directed at removing already existing restrictions on what types of interfaces are allowed to send out DHCP packets (previously, dialer interfaces have not been allowed). This feature also ensures that DHCP RELEASE messages are sent out the interface before a connection is allowed to be broken. DHCP FORCERENEWThe Cisco DHCP FORCERENEW feature provides entity authentication and message authentication, in accordance with RFC 3118, by which 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 FORCERENEW feature requires authentication. All client-server exchanges must be authenticated: The ip dhcp client authentication modeand key chain commands must be configured. When the client gets a FORCERENEW message, it does the following:
The client discards any multicast FORCERENEW message or message that fails authentication. How to Configure the DHCP Client
Configuring the DHCP ClientDHCP Client Default BehaviorCisco routers running Cisco IOS software include DHCP server and relay agent software, which are enabled by default. Your router can act as both the DHCP client and DHCP server. Use the ip address dhcp command to obtain IP address information for the configured interface. Before You Begin
SUMMARY STEPS
You must configure the ip dhcp client commands before entering the ip address dhcp command on an interface to ensure that the DHCPDISCOVER messages that are generated contain the correct option values. The ip dhcp client commands are checked only when an IP address is acquired from DHCP. If any of the ip dhcp client commands are entered after an IP address has been acquired from DHCP, it will not take effect until the next time the router acquires an IP address from DHCP. This means that the new configuration will take effect only after either the ip address dhcp command or the release dhcp and renew dhcpEXECcommandshave been configured. DETAILED STEPS Troubleshooting TipsTo 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. The following are troubleshooting tips for DHCP clients on WAN interfaces:
Forcing a Release or Renewal of a DHCP Lease for a DHCP ClientPerform 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:
This functionality provides the following benefits:
DHCP Release and Renew CLI OperationRelease a DHCP LeaseThe 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 LeaseThe renew dhcp command advances the DHCP lease timer to the next stage, at which point one of the following occurs:
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
Before You Begin
SUMMARY STEPS
The DHCP client must be assigned an IP address by the DHCP server.
DETAILED STEPS Enabling FORCERENEW-Message HandlingPerform this task to specify the type of authentication to be used in 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. Before You Begin
SUMMARY STEPS
You must configure the same authentication mode, and the same secret ID and secret value that were configured in the key chain command, on both the client and the server. DETAILED STEPS
Configuration Examples for the DHCP Client
Example Configuring the DHCP ClientThe 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 E2: interface Ethernet2 ip address dhcp This configuration allows the DHCP client to acquire an IP address from the DHCP server through an Ethernet interface. Example Customizing the DHCP Client ConfigurationThe following example shows how to customize the DHCP client configuration with various options on Ethernet interface 1: interface Ethernet 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 (Multipoint) Using aal5snap Encapsulation and Inverse ARPIn the following example, the protocol ip 255.255.255.255 broadcast configuration 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 ARP can operate on the interface such that the system can be pinged once an address is assigned by DHCP.
interface atm0
ip address dhcp
pvc 1/100
encapsulation aal5snap
broadcast
protocol ip 255.255.255.255 broadcast
protocol ip inarp
Example Releasing a DHCP LeaseIn 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 typeand numberarguments:
Router# release dhcp
Incomplete command. Example Renewing a DHCP LeaseIn 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 typeand numberarguments:
Router# renew dhcp
Incomplete command. Additional ReferencesRelated Documents
MIBsRFCs
Technical Assistance
Feature Information for the DHCP ClientThe 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.
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. © 2012 Cisco Systems, Inc. All rights reserved.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|