Cisco IOS DHCP Server Feature Overview Dynamic Host Control Protocol (DHCP) enables you to automatically assign reusable IP addresses to DHCP clients. The Cisco IOS DHCP Server feature is a full DHCP server implementation that assigns and manages IP addresses from specified address pools within the router to DHCP clients. If the Cisco IOS DHCP Server cannot satisfy a DHCP request from its own database, it can forward the request to one or more secondary DHCP servers defined by the network administrator.
Benefits Note The formal request for the offered IP address (the DHCPREQUEST message) that is sent by the client is broadcast so that all other DHCP servers that received the DHCPDISCOVER broadcast message from the client can reclaim the IP addresses that they offered to the client. If the configuration parameters sent to the client in the DHCPOFFER unicast message by the DHCP server are invalid (a misconfiguration error exists), the client returns a DHCPDECLINE broadcast message to the DHCP server.
• • • • • • • • • • • • Cisco MC3810 series Cisco 4000 series Cisco AS5100 access server Cisco AS5200 universal access server Cisco AS5300 universal access server Cisco 7000 series Cisco 7100 series Cisco 7200 series Cisco MGX 8800 with an installed Route Processor Module Cisco 12000 series Cisco uBR900 series Cisco uBR7200 series Supported Standards, MIBs, and RFCs Standards No new or modified standards are supported by this feature. MIBs No new or modified MIBs are supported by this feature.
Prerequisites Prerequisites Before you configure the Cisco IOS DHCP Server feature, complete the following tasks: • Identify an external File Transport Protocol (FTP), Trivial File Transfer Protocol (TFTP), or remote copy protocol (rcp) server that you will use to store the DHCP bindings database. • Identify the IP addresses that you will enable the DHCP server to assign, and the IP addresses that you will exclude.
Configuring a DHCP Database Agent or Disabling DHCP Conflict Logging Configuring a DHCP Database Agent or Disabling DHCP Conflict Logging A DHCP database agent is any host, for example, an FTP, TFTP, or RCP server that stores the DHCP bindings database. You can configure multiple DHCP database agents and you can configure the interval between database updates and transfers for each agent.
DHCP Configuration Task List Configuring the DHCP Address Pool Subnet and Mask To configure a subnet and mask for the newly created DHCP address pool, which contains the range of available IP addresses that the DHCP server may assign to clients, use the following command in DHCP pool configuration mode: Command Purpose Router(config-dhcp)# network network-number [mask | /prefix-length] Specifies the subnet network number and mask of the DHCP address pool.
Configuring the NetBIOS Node Type for the Client Configuring the NetBIOS Node Type for the Client The NetBIOS node type for Microsoft DHCP clients can be one of four settings: broadcast, peer-to-peer, mixed, or hybrid. To configure the NetBIOS node type for a Microsoft DHCP, use the following command in DHCP pool configuration mode: Command Purpose Router(config-dhcp)# netbios-node-type type Specifies the NetBIOS node type for a Microsoft DHCP client.
DHCP Configuration Task List To configure manual bindings, use the following commands beginning in global configuration mode: Step Command Purpose 1 Router(config)# ip dhcp pool name Creates a name for the a DHCP server address pool and places you in DHCP pool configuration mode—identified by the (config-dhcp)# prompt. 2 Router(config-dhcp)# host address [mask | /prefix-length] Specifies the IP address and subnet mask of the client.
Configuring the Timeout Value for Ping Packets Configuring the Timeout Value for Ping Packets By default, the DHCP server waits 500 milliseconds before timing out a ping packet. To change the amount of time the server waits, use the following command in global configuration mode: Command Purpose Router(config)# ip dhcp ping timeout milliseconds Specifies the amount of time the DHCP server must wait before timing out a ping packet. The default 500 milliseconds.
Configuration Examples To display DHCP server information, use the following commands in EXEC mode, as needed: Command Purpose Router> show ip dhcp binding [address] Displays a list of all bindings created on a specific DHCP server. Router> show ip dhcp conflict [address] Displays a list of all address conflicts recorded by a specific DHCP server. Router# show ip dhcp database [url] Displays recent activity on the DHCP database. Note Use this command in privileged EXEC mode.
Manual Bindings Configuration Example ip dhcp database ftp://user:password@172.16.4.253/router-dhcp write-delay 120 ip dhcp excluded-address 172.16.1.100 172.16.1.103 ip dhcp excluded-address 172.16.2.100 172.16.2.103 ! ip dhcp pool 0 network 172.16.0.0 /16 domain-name cisco.com dns-server 172.16.1.102 172.16.2.102 netbios-name-server 172.16.1.103 172.16.2.103 netbios-node-type h-node ! ip dhcp pool 1 network 172.16.1.0 /24 default-router 172.16.1.100 172.16.1.101 lease 30 ! ip dhcp pool 2 network 172.16.
Command Reference Command Reference This section documents new or modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.0 command reference publications. • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • 12 Release 12.
Manual Bindings Configuration Example In Cisco IOS Release 12.0(1)T or later, you can search and filter the output for show and more commands. This functionality is useful when you need to sort through large amounts of output, or if you want to exclude output that you do not need to see.
Command Reference bootfile To specify the name of the default boot image for a Dynamic Host Configuration Protocol (DHCP) client, use the bootfile DHCP pool configuration command. Use the no form of this command to delete the boot image name. bootfile filename no bootfile Syntax Description filename Specifies the name of the file that is used as a boot image. Defaults No default behavior or values.
clear ip dhcp binding clear ip dhcp binding To delete an automatic address binding from the Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server database, use the clear ip dhcp binding privileged EXEC command. clear ip dhcp binding address | * Syntax Description address The address of the binding you want to clear. * Clears all automatic bindings. Command Modes Privileged EXEC Usage Guidelines Typically, the address denotes the client’s IP address.
Command Reference clear ip dhcp conflict To clear an address conflict from the Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server database, use the clear ip dhcp conflict privileged EXEC command. clear ip dhcp conflict address | * Syntax Description address The IP address of the host that contains the conflicting address you want to clear. * Clears all address conflicts. Command Modes Privileged EXEC Usage Guidelines This command first appeared in Cisco IOS Release 12.0(1)T.
clear ip dhcp server statistics clear ip dhcp server statistics To reset all Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server counters, use the clear ip dhcp server statistics privileged EXEC command. clear ip dhcp server statistics Syntax Description This command has no arguments or keywords. Command Modes Privileged EXEC Usage Guidelines This command first appeared in Cisco IOS Release 12.0(1)T. The show ip dhcp server statistics command displays DHCP counters. All counters are cumulative.
Command Reference client-identifier To specify a Microsoft Dynamic Host Configuration Protocol (DHCP) client’s unique identifier (in dotted-hexadecimal notation), use the client-identifier DHCP pool configuration command. It is valid for manual bindings only. Use the no form of this command to delete the client identifier.
client-name client-name To specify the name of a Dynamic Host Configuration Protocol (DHCP) client, use the client-name DHCP pool configuration command. The client name should not include the domain name. Use the no form of this command to remove the client name. client-name name no client-name Syntax Description name Specifies the client’s name, using any standard ASCII character. The client name should not include the domain name. For example, the name mars should not be specified as mars.cisco.com.
Command Reference default-router To specify the default router list for a Dynamic Host Configuration Protocol (DHCP) client, use the default-router DHCP pool configuration command. Use the no form of this command to remove the default router list. default-router address [address2 ... address8] no default-router Syntax Description address Specifies the IP address of a router. One IP address is required, although you can specify up to eight addresses in one command line.
dns-server dns-server To specify the Domain Name System (DNS) IP servers available to a Dynamic Host Configuration Protocol (DHCP) client, use the dns-server DHCP pool configuration command. Use the no form of this command to remove the DNS server list. dns-server address [address2 ... address8] no dns-server Syntax Description address Specifies the IP address of a DNS server. One IP address is required, although you can specify up to eight addresses in one command line.
Command Reference domain-name To specify the domain name for a Dynamic Host Configuration Protocol (DHCP) client, use the domain-name DHCP pool configuration command. Use the no form of this command to remove the domain name. domain-name domain no domain-name Syntax Description domain Specifies the client’s domain name string. Defaults None. Command Modes DHCP pool configuration Usage Guidelines This command first appeared in Cisco IOS Release 12.0(1)T. Examples The following example specifies cisco.
hardware-address hardware-address To specify the hardware address of a Dynamic Host Configuration Protocol (DHCP) client, use the hardware-address DHCP pool configuration command. It is valid for manual bindings only. Use the no form of this command to remove the hardware address. hardware-address hardware-address type no hardware-address Syntax Description hardware-address Specifies the MAC address of the client’s hardware platform. type Indicates the protocol of the hardware platform.
Command Reference host To specify the IP address and network mask for a manual binding to a Dynamic Host Configuration Protocol (DHCP) client, use the host DHCP pool configuration command. Use the no form of this command to remove the client’s IP address. host address [mask | /prefix-length] no host Syntax Description address Specifies the IP address of the client. mask (Optional) Specifies the network mask of the client.
ip dhcp conflict logging ip dhcp conflict logging To enable conflict logging on a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server, use the ip dhcp conflict logging global configuration command. Use the no form of this command to disable conflict logging. ip dhcp conflict logging no ip dhcp conflict logging Syntax Description This command has no arguments or keywords. Defaults Conflict logging is enabled.
Command Reference ip dhcp database You can configure a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server to save automatic bindings on a remote host called a database agent. To configure a DHCP server database agent and database agent parameters, use the ip dhcp database global configuration command. Use the no form of this command to remove the database agent.
ip dhcp database Related Commands show ip dhcp database Cisco IOS DHCP Server 27
Command Reference ip dhcp excluded-address To specify IP addresses that a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server should not assign to DHCP clients, use the ip dhcp excluded-address global configuration command. Use the no form of this command to remove the excluded IP addresses.
ip dhcp ping packets ip dhcp ping packets To specify the number of packets a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server sends to a pool address as part of a ping operation, use the ip dhcp ping packets global configuration command. Use the no form of this command to prevent the server from pinging pool addresses.
Command Reference ip dhcp ping timeout To specify how long a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server waits for a ping reply from an address pool, use the ip dhcp ping timeout global configuration command. Use the no form of this command to restore the default number of milliseconds (500) of the timeout.
ip dhcp pool ip dhcp pool To configure a Dynamic Host Configuration Protocol (DHCP) address pool on a Cisco IOS DHCP Server and enter DHCP pool configuration mode, use the ip dhcp pool global configuration command. Use the no form of this command to remove the address pool. ip dhcp pool name no ip dhcp pool name Syntax Description name Can either be a symbolic string (such as “engineering”) or an integer (such as 0). Defaults DHCP address pools are not configured.
Command Reference ip dhcp relay information check To configure a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server to validate the relay agent information option in forwarded BOOTREPLY messages, use the ip dhcp relay information check global configuration command. Use the no form of this command to disable an information check. ip dhcp relay information check no ip dhcp relay information check Syntax Description This command has no arguments or keywords.
ip dhcp relay information option ip dhcp relay information option To configure a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server to insert the DHCP relay agent information option in forwarded BOOTREQUEST messages, use the ip dhcp relay information option global configuration command. Use the no form of this command to disable inserting relay information to forwarded BOOTREQUEST messages.
Command Reference ip dhcp relay information policy To configure a Dynamic Host Configuration Protocol (DHCP) relay agent’s information reforwarding policy (what a DHCP relay agent should do if a message already contains relay information), use the ip dhcp relay information policy global configuration command. Use the no form of this command to restore the default relay information policy.
lease lease To configure the duration of the lease for an IP address that is assigned from a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server to a DHCP client, use the lease DHCP pool configuration command. Use the no form of this command to restore the default value. lease {days [hours][minutes] | infinite} no lease Syntax Description days Specifies the duration of the lease in numbers of days. hours (Optional) Specifies the number of hours in the lease.
Command Reference netbios-name-server To configure NetBIOS Windows Internet Naming Service (WINS) name servers that are available to Microsoft Dynamic Host Configuration Protocol (DHCP) clients, use the netbios-name-server DHCP pool configuration command. Use the no form of this command to remove the NetBIOS name server list. netbios-name-server address [address2...address8] no netbios-name-server Syntax Description address Specifies the IP address of the NetBIOS WINS name server.
netbios-node-type netbios-node-type To configure the NetBIOS node type for Microsoft Dynamic Host Configuration Protocol (DHCP) clients, use the netbios-node-type DHCP pool configuration command. Use the no form of this command to remove the NetBIOS node type. netbios-node-type type no netbios-node-type Syntax Description type Specifies the NetBIOS node type.
Command Reference network (DHCP) To configure the subnet number and mask for a Dynamic Host Configuration Protocol (DHCP) address pool on a Cisco IOS DHCP Server, use the network DHCP pool configuration command. Use the no form of this command to remove the subnet number and mask. network network-number [mask | /prefix-length] no network Syntax Description network-number The IP address of the DHCP address pool.
next-server next-server To configure the next server in a Dynamic Host Configuration Protocol (DHCP) client’s boot process, use the next-server DHCP pool configuration command. Use the no form of this command to remove the boot server list. next-server address [address2...address8] no next-server address Syntax Description address Specifies the IP address of the next server in the boot process, which is typically a Trivial File Transfer Protocol (TFTP) server.
Command Reference option To configure Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server options, use the option DHCP pool configuration command. Use the no form of this command to remove the options. option code [instance number] {ascii string | hex string | ip address} no option code [instance number] Syntax Description code Specifies the DHCP option code. instance number (Optional) Specifies a number from 0 to 255. ascii string Specifies an NVT ASCII character string.
option Related Commands ip dhcp pool Cisco IOS DHCP Server 41
Command Reference service dhcp To enable the Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server feature on your router, use the service dhcp global configuration command. Use the no form of this command to disable the Cisco IOS DHCP Server feature. service dhcp no service dhcp Syntax Description This command has no keywords or arguments. Defaults The feature is enabled. Command Modes Global configuration Usage Guidelines This command first appeared in Cisco IOS Release 12.0(1)T.
show ip dhcp binding show ip dhcp binding To display address bindings on the Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server, use the show ip dhcp binding EXEC command. show ip dhcp binding [address] Syntax Description address (Optional) Specifies the IP address of the DHCP client for which bindings will be displayed. Defaults None Command Modes EXEC Usage Guidelines This command first appeared in Cisco IOS Release 12.0(1)T. If the address is not specified, all address bindings are shown.
Command Reference Related Commands clear ip dhcp binding 44 Release 12.
show ip dhcp conflict show ip dhcp conflict To display address conflicts found by a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server when addresses are offered to the client, use the show ip dhcp conflict EXEC command. show ip dhcp conflict [address] Syntax Description address (Optional) Specifies the IP address of the conflict found. Defaults None Command Modes EXEC Usage Guidelines This command first appeared in Cisco IOS Release 12.0(1)T. The server detects conflicts using ping.
Command Reference show ip dhcp database To display Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server database agent information, use the show ip dhcp database Privileged EXEC command. show ip dhcp database [url] Syntax Description url (Optional) Specifies the remote file used to store automatic DHCP bindings.
show ip dhcp database Table 4 show ip dhcp database Field Descriptions (continued) Field Description Read The last time bindings were read from the file server. Written The last time bindings were written to the file server. Status Indication of whether the last read or write of host bindings was successful. Delay The amount of time to wait before updating the database. Timeout The amount of time before the file transfer is aborted. Failures The number of failed file transfers.
Command Reference show ip dhcp server statistics To display Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server statistics, use the show ip dhcp server statistics EXEC command. show ip dhcp server statistics Syntax Description This command has no arguments or keywords. Defaults None Command Modes EXEC Usage Guidelines This command first appeared in Cisco IOS Release 12.0(1)T. Examples The following example displays DHCP server statistics.
show ip dhcp server statistics Table 5 show ip dhcp server statistics Field Descriptions Field Description Memory usage The number of bytes of RAM allocated by the DHCP server. Address pools The number of configured address pools in the DHCP database. Database agents The number of database agents configured in the DHCP database. Automatic bindings The number of IP addresses that have been automatically mapped to the MAC addresses of hosts that are found in the DHCP database.
Debug Commands Debug Commands This section describes the following new debug command: • 50 Release 12.
debug ip dhcp server debug ip dhcp server To enable Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server debugging, use the debug ip dhcp server privileged EXEC command. Use the no form of this command to disable DHCP server debugging. debug ip dhcp server {events | packets | linkage} no debug ip dhcp server {events | packets | linkage} Syntax Description events Reports server events, like address assignments and database updates. packets Decodes DHCP receptions and transmissions.
Glossary Glossary address binding—A mapping between the client’s IP and hardware (MAC) addresses. The client’s IP address may be configured by the administrator (manual address allocation) or assigned from a pool by the DHCP server (automatic address allocation). The binding also contains a lease expiration date. The default for the lease expiration date is one day. address conflict—A duplication of use of the same IP address by two hosts.