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 speci???ed 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 de???ned by the network administrator.
Figure 1 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 Cisco IOS DHCP Server. A DHCP server offers con???guration parameters (such as an IP address, a MAC address, a domain name, and a lease for the IP address) to the client in a DHSCPOFFER unicast message.
Figure 1 DHCP Request for an IP Address from a DHCP Server
DHCPDISCOVER (broadcast)
Host A
DHCPOFFER (unicast)
DHCPREQUEST (broadcast)
DHCPACK (unicast)
Cisco IOS DHCP server
32369
Note A DHCP client may receive offers from multiple DHCP servers and can accept any one of the offers; however, the client usually accepts the ???rst 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 con???rms that the IP address has been allocated to the client by returning a DHCPACK unicast message to the client.
Cisco IOS DHCP Server 1
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 con???guration parameters sent to the client in the DHCPOFFER unicast message by the DHCP server are invalid (a miscon???guration error exists), the client returns a DHCPDECLINE broadcast message to the DHCP server.
The DHCP server will send to the client a DHCPNAK denial broadcast message, which means the offered con???guration parameters have not been assigned, if an error has occurred during the negotiation of the parameters or the client has been slow in responding to the DHCPOFFER message (the DHCP server assigned the parameters to another client) of the DHCP server.
Bene???ts
The Cisco IOS DHCP Server feature offers the following bene???ts:
???Reduced Internet access costs
Using automatic IP address assignment at each remote site substantially reduces Internet access costs. Static IP addresses are considerably more expensive to purchase than are automatically allocated IP addresses.
???Reduced client con???guration tasks and cost s
Because DHCP is easy to con???gure, it minimizes operational overhead and costs associated with device con???guration tasks and eases deployment by nontechnical users.
???Centralized management
Because the DHCP server maintains con???gurations for several subnets, an administrator only needs to update a single, central server when con???guration parameters change.
Supported Platforms
This Cisco IOS DHCP Server feature is supported on the following routers and access servers:
???Catalyst 5000 family switches with an installed Route Switch Module
???Catalyst 6000 family switches with an installed MultiLayer Switch Feature Card
???Catalyst 8500 series
???Cisco 800 series
???Cisco 1000 series
???Cisco 1400 series
???Cisco 1600 series
???Cisco 1700 series (support for the Cisco 1700 series was added in Cisco IOS Release 12.0[2]T)
???Cisco 2500 series
???Cisco 2600 series
???Cisco 3600 series
???Cisco 3800 series
2 Release 12.0(1)T
???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 modi???ed standards are supported by this feature.
MIBs
No new or modi???ed MIBs are supported by this feature.
For descriptions of supported MIBs and how to use MIBs, see the Cisco MIB web site on CCO at
RFCs
???RFC 951, Bootstrap Protocol (BOOTP)
???RFC 1542, Clari???cations and Extensions for the Bootstrap Protocol
???RFC 2131, Dynamic Host Con???guration Protocol
???RFC 2132, DHCP Options and BOOTP Vendor Extensions
Cisco IOS DHCP Server 3
Prerequisites
Prerequisites
Before you con???gure 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.
???Identify DHCP options for devices where necessary, including:
???Default boot image name
???Default router(s)
???Domain Name System (DNS) server(s)
???NetBIOS name server
???Decide on a NetBIOS node type (b, p, m, or h).
???Decide on a DNS domain name.
DHCP Con???guration Task List
The DHCP server database is organized as a tree. The root of the tree is the address pool for natural networks, branches are subnetwork address pools, and leaves are manual bindings to clients. Subnetworks inherit network parameters and clients inherit subnetwork parameters. Therefore, common parameters, for example the domain name, should be con???gured at the highest (network or subnetwork) level of the tree.
Note Inherited parameters can be overridden. For example, if a parameter is de???ned in both the natural network and a subnetwork, the de???nition of the subnetwork is used.
Address leases are not inherited. If a lease is not speci???ed for an IP address, by default, the DHCP server assigns a
To con???gure the Cisco IOS DHCP Server feature, ???rst con???gure a database agent or disable con???ict logging, then con???gure IP addresses that the DHCP server should not assign (excluded addresses) and should assign (a pool of available IP addresses) to requesting clients. These con???guration tasks are explained in the following sections. Each task in the following list is identi???ed as required or optional.
???
???
???
???
???
???
???
???
Con???guring a DHCP Database Agent or Disabling DHCP Con???ict Logging (Required)
Excluding IP Addresses (Required)
Con???guring a DHCP Address Pool (Required)
Con???guring Manual Bindings (Optional)
Con???guring a DHCP Server Boot File (Optional)
Con???guring the Number of Ping Packets (Optional)
Con???guring the Timeout Value for Ping Packets (Optional)
Enabling the Cisco IOS DHCP Server Feature (Optional)
4 Release 12.0(1)T
Configuring a DHCP Database Agent or Disabling DHCP Conflict Logging
Con???guring a DHCP Database Agent or Disabling DHCP Con???ict Logging
A DHCP database agent is any host, for example, an FTP, TFTP, or RCP server that stores the DHCP bindings database. You can con???gure multiple DHCP database agents and you can con???gure the interval between database updates and transfers for each agent. To con???gure a database agent and database agent parameters, use the following command in global con???guration mode:
If you choose not to con???gure a DHCP database agent, disable the recording of DHCP address con???icts on the DHCP server. To disable DHCP address con???ict logging, use the following command in global con???guration mode:
Excluding IP Addresses
The DHCP server assumes that all IP addresses in a DHCP address pool subnet are available for assigning to DHCP clients. You must specify the IP address that the DHCP server should not assign to clients. To do so, use the following command in global con???guration mode:
Con???guring a DHCP Address Pool
You can con???gure a DHCP address pool with a name that is a symbolic string (such as ???engineering???) or an integer (such as 0). Con???guring a DHCP address pool also places you in DHCP pool con???guration
pool parameters (for example, the IP subnet number and default router list). To con???gure a DHCP address pool, complete the required tasks in the following sections.
Con???guring the DHCP Address Pool Name and Entering DHCP Pool Con???guration Mode
To con???gure the DHCP address pool name and enter DHCP pool con???guration mode, use the following command in global con???guration mode:
Router(con???g)# ip dhcp pool name Creates a name for the DHCP server address pool and places you in DHCP pool con???guration mode (identi???ed by the
Cisco IOS DHCP Server 5
DHCP Configuration Task List
Con???guring the DHCP Address Pool Subnet and Mask
To con???gure 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 con???guration mode:
Note You can not con???gure manual bindings within the same pool that is con???gured with the network command. To con???gure manual bindings, see the ???Con???guring Manual Bindings??? section.
Con???guring the Domain Name for the Client
The domain name of a DHCP client places the client in the general grouping of networks that make up the domain. To con???gure a domain name string for the client, use the following command in DHCP pool con???guration mode:
Con???guring the Domain Name System IP Servers for the Client
DHCP clients query DNS IP servers when they need to correlate host names to IP addresses. To con???gure the DNS IP servers that are available to a DHCP client, use the following command in DHCP pool con???guration mode:
specify up to eight IP addresses in one command line.
Con???guring the NetBIOS Windows Internet Naming Service IP Servers for the Client
Windows Internet Naming Service (WINS) is a name resolution service that Microsoft DHCP clients use to correlate host names to IP addresses within a general grouping of networks. To con???gure the NetBIOS WINS servers that are available to a Microsoft DHCP client, use the following command in DHCP pool con???guration mode:
can specify up to eight addresses in one command line.
6 Release 12.0(1)T
Configuring the NetBIOS Node Type for the Client
Con???guring the NetBIOS Node Type for the Client
The NetBIOS node type for Microsoft DHCP clients can be one of four settings: broadcast,
type
Con???guring the Default Router for the Client
After a DHCP client has booted, the client begins sending packets to its default router. The IP address of the default router should be on the same subnet as the client. To con???gure a default router for a DHCP client, use the following command in DHCP pool con???guration mode:
eight addresses in one command line.
Con???guring the Address Lease Time
By default, each IP address assigned by a DHCP server comes with a
Con???guring Manual Bindings
An address binding is a mapping between the IP address and Media Access Control (MAC) address of a client. The IP address of a client can be assigned manually by an administrator or assigned automatically from a pool by a DHCP server.
Manual bindings are IP addresses that have been manually mapped to the MAC addresses of hosts that are found in the DHCP database. Manual bindings are stored in NVRAM on the DHCP server. Manual bindings are just special address pools. There is no limit on the number of manual bindings but you can only con???gure one manual binding per host pool.
Automatic bindings are IP addresses that have been automatically mapped to the MAC addresses of hosts that are found in the DHCP database. Automatic bindings are stored on a remote host called a database agent. The bindings are saved as text records for easy maintenance.
To con???gure a manual binding, ???rst create a host pool, then specify the IP address and hardware address of the client or client identi???er. The hardware address is the MAC address. The client identi???er, which is required for Microsoft clients (instead of hardware addresses), is formed by concatenating the media type and the MAC address of the client. Refer to the ???Address Resolution Protocol Parameters??? section of RFC 1700, Assigned Numbers, for a list of media type codes.
Cisco IOS DHCP Server 7
DHCP Configuration Task List
To con???gure manual bindings, use the following commands beginning in global con???guration mode:
should not include the domain name. For example, the name mars should not be speci???ed as mars.cisco.com.
Configuring a DHCP Server Boot File
The boot ???le is used to store the boot image for the client. The boot image is generally the operating system the client uses to load. To specify a boot ???le for the DHCP client, use the following command in DHCP pool con???guration mode:
Con???guring the Number of Ping Packets
By default, the DHCP server pings a pool address twice before assigning the address to a requesting client. If the ping is unanswered, the DHCP server assumes (with a high probability) that the address is not in use and assigns the address to the requesting client. To change the number of ping packets the DHCP server should send to the pool address before assigning the address, use the following command in global con???guration mode:
Router(con???g)# ip dhcp ping packets Speci???es the number of ping packets the DHCP server sends to numbera pool address before assigning the address to a requesting cli-
ent. The default is two packets.
8 Release 12.0(1)T
Configuring the Timeout Value for Ping Packets
Con???guring 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 con???guration mode:
Enabling the Cisco IOS DHCP Server Feature
By default, the Cisco IOS DHCP Server feature is enabled on your router. If the feature is disabled, use the following command in global con???guration mode to reenable the Cisco IOS DHCP Server feature on your router:
Monitoring and Maintaining the DHCP Server
To clear DHCP server variables, use the following commands in privileged EXEC mode, as needed:
Router# clear ip dhcp binding address | * Deletes an automatic address binding from the DHCP database. Specifying address clears the automatic binding for a speci???c (client) IP address whereas specifying asterisk ( *) clears all automatic bindings.
Router# clear ip dhcp con???ict address | * Clears an address con???ict from the DHCP database. Specify- ing address clears the con???ict for a speci???c IP address whereas specifying an asterisk (*) clears con???icts for all addresses.
To enable DHCP server debugging, use the following command in privileged EXEC mode, as needed:
Cisco IOS DHCP Server 9
Configuration Examples
To display DHCP server information, use the following commands in EXEC mode, as needed:
Con???guration Examples
This section provides the following con???guration examples:
???DHCP Database Agent Con???guration Example
???DHCP Address Pool Con???guration Example
???Manual Bindings Con???guration Example
DHCP Database Agent Con???guration Example
The following example stores bindings on host 172.16.4.253. The ???le transfer protocol is FTP. The server should wait 2 minutes (120 seconds) before writing database changes.
ip dhcp database
DHCP Address Pool Con???guration Example
In the following example, three DHCP address pools are created: one in network 172.16.0.0, one in subnetwork 172.16.1.0, and one in subnetwork 172.16.2.0. Attributes from network 172.16.0.0, such as the domain name, DNS server, NetBIOS name server, and NetBIOS node type, are inherited in subnetworks 172.16.1.0 and 172.16.2.0. In each pool, clients are granted
10 Release 12.0(1)T
Manual Bindings Configuration Example
ip dhcp database
ip dhcp
!
ip dhcp pool 0
network 172.16.0.0 /16
!
ip dhcp pool 1
network 172.16.1.0 /24
!
ip dhcp pool 2
network 172.16.2.0 /24
Manual Bindings Con???guration Example
The following example creates a manual binding for a client named Mars.cisco.com. The MAC address of the client is 02c7.f800.0422 and the IP address of the client is 172.16.2.254.
ip dhcp pool Mars host 172.16.2.254
Because attributes are inherited, the previous con???guration is equivalent to the following:
ip dhcp pool Mars
host 172.16.2.254 mask 255.255.255.0
Cisco IOS DHCP Server 11
Command Reference
Command Reference
This section documents new or modi???ed commands. All other commands used with this feature are documented in the Cisco IOS Release 12.0 command reference publications.
???boot???le
???clear ip dhcp server statistics
???
???
???
???host
???ip dhcp pool
???ip dhcp relay information check
???ip dhcp relay information option
???ip dhcp relay information policy
???lease
???
???option
???service dhcp
12 Release 12.0(1)T
Manual Bindings Configuration Example
In Cisco IOS Release 12.0(1)T or later, you can search and ???lter 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.
To use this functionality, enter a show or more command followed by the ???pipe??? character (|), one of the keywords begin, include, or exclude, and an expression that you want to search or ???lter on:
command | {begin | include | exclude}
Following is an example of the show atm vc command in which you want the command output to begin with the ???rst line where the expression ???PeakRate??? appears:
show atm vc | begin PeakRate
For more information on the search and ???lter functionality, refer to the Cisco IOS Con???guration Fundamentals Con???guration Guide .
Cisco IOS DHCP Server 13
Command Reference
boot???le
To specify the name of the default boot image for a Dynamic Host Configuration Protocol (DHCP) client, use the boot???le DHCP pool con???guration command. Use the no form of this command to delete the boot image name.
boot???le ???lename
no boot???le
Syntax Description
Defaults
No default behavior or values.
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Examples
The following example speci???es xllboot as the name of the boot ???le:
bootfile xllboot
Related Commands
ip dhcp pool
14 Release 12.0(1)T
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
Command Modes
Privileged EXEC
Usage Guidelines
Typically, the address denotes the client???s IP address. If the asterisk (*) character is used as the address parameter, DHCP clears all automatic bindings.
Use the no ip dhcp pool global con???guration command to delete a manual binding.
Examples
The following example deletes the address binding 10.12.1.99 from a DHCP server database:
clear ip dhcp binding 10.12.1.99
Related Commands
show ip dhcp binding
Cisco IOS DHCP Server 15
Command Reference
clear ip dhcp con???ict
To clear an address con???ict from the Cisco IOS Server database, use the clear ip dhcp con???ict
Dynamic Host Configuration Protocol (DHCP) privileged EXEC command.
clear ip dhcp con???ict address | *
Syntax Description
Command Modes
Privileged EXEC
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
The server detects con???icts using a ping session. The client detects con???icts using gratuitous Address Resolution Protocol (ARP). If the asterisk (*) character is used as the address parameter, DHCP clears all con???icts.
Examples
The following example shows an address con???ict of 10.12.1.99 being deleted from the DHCP server database:
clear ip dhcp conflict 10.12.1.99
Related Commands
show ip dhcp con???ict
16 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 ???rst appeared in Cisco IOS Release 12.0(1)T.
The show ip dhcp server statistics command displays DHCP counters. All counters are cumulative. The counters will be initialized, or set to zero, with this command.
Examples
The following example resets all DHCP counters to zero:
clear ip dhcp server statistics
Related Commands
show ip dhcp server statistics
Cisco IOS DHCP Server 17
Command Reference
To specify a Microsoft Dynamic Host Configuration Protocol (DHCP) client???s unique identi???er (in
no
Syntax Description
Defaults
None
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Microsoft DHCP clients require client identi???ers instead of hardware addresses. The client identi???er is formed by concatenating the media type and the MAC address. For example, the Microsoft client identi???er for Ethernet address b708.1388.f166 is 01b7.0813.88f1.66, where 01 represents the Ethernet media type. For a list of media type codes, refer to the ???Address Resolution Protocol Parameters??? section of RFC 1700, Assigned Numbers.
Examples
The following example speci???es the client identi???er for Mac address b7.0813.8811.66 in
Related Commands
ip dhcp pool
18 Release 12.0(1)T
To specify the name of a Dynamic Host Configuration Protocol (DHCP) client, use the
Syntax Description
Defaults
None
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Examples
The following example speci???es a string client1 that will be the name of the client:
Related Commands
host
ip dhcp pool
Cisco IOS DHCP Server 19
Command Reference
To specify the default router list for a Dynamic Host Configuration Protocol (DHCP) client, use the
no
Syntax Description
Defaults
None
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
The IP address of the router should be on the same subnet as the client subnet. You can specify up to eight routers in the list. Routers are listed in order of preference (address1 is the most preferred router, address2 is the next most preferred router, and so on).
Examples
The following example speci???es 10.12.1.99 as the IP address of the default router:
Related Commands
ip dhcp pool
20 Release 12.0(1)T
To specify the Domain Name System (DNS) IP servers available to a Dynamic Host Configuration Protocol (DHCP) client, use the
no
Syntax Description
Defaults
If DNS IP servers are not con???gured for a DHCP client, the client cannot correlate host names to IP addresses.
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Servers are listed in order of preference (address1 is the most preferred server, address2 is the next most preferred server, and so on).
Examples
The following example speci???es 10.12.1.99 as the IP address of the domain name server of the client:
Related Commands
Cisco IOS DHCP Server 21
Command Reference
To specify the domain name for a Dynamic Host Configuration Protocol (DHCP) client, use the
no
Syntax Description
Defaults
None.
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Examples
The following example speci???es cisco.com as the domain name of the client:
Related Commands
22 Release 12.0(1)T
To specify the hardware address of a Dynamic Host Configuration Protocol (DHCP) client, use the
no
Syntax Description
Defaults
Ethernet is the default type if none is speci???ed.
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Examples
The following example speci???es b708.1388.f166 as the MAC address of the client:
Related Commands
ip dhcp pool
Cisco IOS DHCP Server 23
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 con???guration command. Use the no form of this command to remove the client???s IP address.
host address [mask
no host
Syntax Description
Defaults
None
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
If the mask and pre???x length are unspeci???ed, DHCP examines its address pools. If no mask is found in the pool database, the Class A, B, or C natural mask is used. This command is valid for manual bindings only.
There is no limit on the number of manual bindings but you can only con???gure one manual binding per host pool.
Examples
The following example speci???es 10.12.1.99 as the client???s IP address and 255.255.248.0 as the subnet mask:
host 10.12.1.99 255.255.248.0
Related Commands
24 Release 12.0(1)T
ip dhcp conflict logging
ip dhcp con???ict logging
To enable con???ict logging on a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server, use the ip dhcp con???ict logging global con???guration command. Use the no form of this command to disable con???ict logging.
ip dhcp con???ict logging
no ip dhcp con???ict logging
Syntax Description
This command has no arguments or keywords.
Defaults
Con???ict logging is enabled.
Command Modes
Global con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Cisco recommends using a DHCP server database agent to store automatic bindings. If you decide not to use a DHCP server database agent to store automatic bindings, use the no ip dhcp con???ict logging command to disable the recording of address con???icts. By default, the Cisco IOS DHCP Server records DHCP address con???icts in a log ???le.
Example
The following example disables the recording of DHCP address con???icts:
no ip dhcp conflict logging
Related Commands
clear ip dhcp con???ict ip dhcp database show ip dhcp con???icts
Cisco IOS DHCP Server 25
Command Reference
ip dhcp database
You can con???gure a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server to save automatic bindings on a remote host called a database agent. To con???gure a DHCP server database agent and database agent parameters, use the ip dhcp database global con???guration command. Use the no form of this command to remove the database agent.
ip dhcp database url [timeout seconds |
no ip dhcp database url
Syntax Description
Defaults
DHCP waits 300 seconds for both a write delay and a timeout.
Command Modes
Global con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
The administrator may con???gure multiple database agents. Bindings are transferred by using the File Transfer Protocol (FTP), Trivial File Transport Protocol (TFTP), or remote copy protocol (RCP).
Example
The following example speci???es the DHCP database transfer timeout value at 80 seconds:
ip dhcp database
The following example speci???es the DHCP database update delay value at 100 seconds:
ip dhcp database
26 Release 12.0(1)T
ip dhcp database
Related Commands
show ip dhcp database
Cisco IOS DHCP Server 27
Command Reference
ip dhcp
To specify IP addresses that a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server should not assign to DHCP clients, use the ip dhcp
ip dhcp
no ip dhcp
Syntax Description
Defaults
All IP pool addresses are assignable.
Command Modes
Global con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
The DHCP server assumes that all pool addresses may be assigned to clients. Use this command to exclude a single IP address or a range of IP addresses.
Example
The following example con???gures an excluded IP address range from 172.16.1.100 through 172.16.1.199:
ip dhcp
Related Commands
ip dhcp pool network (DHCP)
28 Release 12.0(1)T
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 con???guration command. Use the no form of this command to prevent the server from pinging pool addresses.
ip dhcp ping packets count
no ip dhcp ping packets
Syntax Description
Defaults
Two packets
Command Modes
Global con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
The DHCP server pings a pool address before assigning the address to a requesting client. If the ping is unanswered, the DHCP server assumes (with a high probability) that the address is not in use and assigns the address to the requesting client.
Examples
The following example speci???es ???ve ping attempts by the DHCP server before ceasing any further ping attempts:
ip dhcp ping packets 5
Related Commands
clear ip dhcp con???icts ip dhcp ping timeout show ip dhcp con???icts
Cisco IOS DHCP Server 29
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 con???guration command. Use the no form of this command to restore the default number of milliseconds (500) of the timeout.
ip dhcp ping timeout milliseconds
no ip dhcp ping timeout
Syntax Description
Defaults
500 milliseconds
Command Modes
Global con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
This command speci???es how long to wait for a ping reply in milliseconds.
Examples
The following example speci???es that the DHCP server will wait 800 milliseconds for a ping reply before considering the ping a failure:
ip dhcp ping timeout 800
Related Commands
clear ip dhcp con???icts ip dhcp ping packets show ip dhcp con???icts
30 Release 12.0(1)T
ip dhcp pool
ip dhcp pool
To con???gure a Dynamic Host Configuration Protocol (DHCP) address pool on a Cisco IOS DHCP Server and enter DHCP pool con???guration mode, use the ip dhcp pool global con???guration command. Use the no form of this command to remove the address pool.
ip dhcp pool name
no ip dhcp pool name
Syntax Description
Defaults
DHCP address pools are not con???gured.
Command Modes
Global con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
During execution, the con???guration mode changes to DHCP pool con???guration mode, identi???ed by the
Examples
The following example con???gures pool1 as the DHCP address pool:
ip dhcp pool pool1
Related Commands
host
ip dhcp
Cisco IOS DHCP Server 31
Command Reference
ip dhcp relay information check
To con???gure 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 con???guration 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.
Defaults
The DHCP server checks relay information. Invalid messages are dropped.
Command Modes
Global con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
This command is used by cable modem termination systems. By default, DHCP checks relay information. Invalid messages are dropped.
Examples
The following example con???gures the DHCP server to check that the relay agent information option in forwarded BOOTREPLY messages is valid:
ip dhcp relay information check
Related Commands
ip dhcp relay information option ip dhcp relay information policy
32 Release 12.0(1)T
ip dhcp relay information option
ip dhcp relay information option
To con???gure 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 con???guration command. Use the no form of this command to disable inserting relay information to forwarded BOOTREQUEST messages.
ip dhcp relay information option
no ip dhcp relay information option
Syntax Description
This command has no arguments or keywords.
Defaults
The DHCP server does not insert relay information.
Command Modes
Global con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
This command is used by cable modem termination systems. By default, DHCP does not insert relay information.
Examples
The following example con???gures a DHCP server to insert the DHCP relay agent information option in forwarded BOOTREQUEST messages:
ip dhcp relay information option
Related Commands
ip dhcp relay information check ip dhcp relay information policy
Cisco IOS DHCP Server 33
Command Reference
ip dhcp relay information policy
To con???gure 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 con???guration command. Use the no form of this command to restore the default relay information policy.
ip dhcp relay information policy {drop | keep | replace}
no ip dhcp relay information policy
Syntax Description
Defaults
The DHCP server replaces existing relay information.
Command Modes
Global con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
This command is used by cable modem termination systems. When a DHCP relay agent receives a message from a another DHCP relay agent, relay information might already be present in the message. By default, the relay information from the previous relay agent is replaced.
Examples
The following examples con???gure a DHCP relay agent to drop messages with existing relay information, keep existing information, and replace existing information:
ip dhcp relay information policy drop
ip dhcp relay information policy keep
ip dhcp relay information policy replace
Related Commands
ip dhcp relay information check ip dhcp relay information option
34 Release 12.0(1)T
lease
lease
To con???gure 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 con???guration command. Use the no form of this command to restore the default value.
lease {days [hours][minutes] | in???nite }
no lease
Syntax Description
Defaults
One day
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Examples
The following example shows a
lease 1
The following example shows a
lease 0 1
The following example shows a
lease 0 0 1
The following example shows an in???nite (unlimited) lease:
lease infinite
Related Commands
ip dhcp pool
Cisco IOS DHCP Server 35
Command Reference
To con???gure NetBIOS Windows Internet Naming Service (WINS) name servers that are available to Microsoft Dynamic Host Configuration Protocol (DHCP) clients, use the
no
Syntax Description
Defaults
None
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
One IP address is required, although you can specify up to eight addresses in one command line. Servers are listed in order of preference (address1 is the most preferred server, address2 is the next most preferred server, and so on).
Examples
The following example speci???es the IP address of a NetBIOS name server available to the client:
Related Commands
36 Release 12.0(1)T
To con???gure the NetBIOS node type for Microsoft Dynamic Host Configuration Protocol (DHCP) clients, use the
no
Syntax Description
Defaults
None
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
The recommended type is
Examples
The following example speci???es the client???s NetBIOS type as hybrid:
netbios
Related Commands
ip dhcp pool
Cisco IOS DHCP Server 37
Command Reference
network (DHCP)
To con???gure 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 con???guration command. Use the no form of this command to remove the subnet number and mask.
network
no network
Syntax Description
Defaults
None
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
This command is valid for DHCP subnetwork address pools only. If the mask or pre???x length is not speci???ed, the class A, B, or C natural mask is used. The DHCP server assumes that all host addresses are available. The system administrator can exclude subsets of the address space by using the ip dhcp
You can not con???gure manual bindings within the same pool that is con???gured with the network command.
Examples
The following example con???gures 172.16.0.0/16 as the DHCP pool???s subnetwork number and mask:
network 172.16.0.0 /16
Related Commands
host
ip dhcp
38 Release 12.0(1)T
To con???gure the next server in a Dynamic Host Configuration Protocol (DHCP) client???s boot process, use the
no
Syntax Description
Defaults
If the
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
You can specify up to eight servers in the list. Servers are listed in order of preference (address1 is the most preferred server, address2 is the next most preferred server, and so on).
Examples
The following example speci???es 10.12.1.99 as the IP address of the next server in the boot process:
Related Commands
boot???le
ip dhcp pool
ip
Cisco IOS DHCP Server 39
Command Reference
option
To con???gure Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server options, use the option DHCP pool con???guration 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
Defaults
The default instance number is 0.
Command Modes
DHCP pool con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
DHCP provides a framework for passing con???guration information to hosts on a TCP/IP network. Con???guration parameters and other control information are carried in tagged data items that are stored in the options ???eld of the DHCP message. The data items themselves are also called options. The current set of DHCP options are documented in RFC 2131, Dynamic Host Con???guration Protocol.
Examples
The following example con???gures DHCP option 19, which speci???es whether the client should con???gure its IP layer for packet forwarding. A value of 0 means disable IP forwarding; a value of 1 means enable IP forwarding. IP forwarding is enabled in the following example:
option 19 hex 01
The following example con???gures DHCP option 72, which speci???es the World Wide Web servers for DHCP clients. World Wide Web servers 172.16.3.252 and 172.16.3.253 are con???gured in the following example:
option 72 ip 172.16.3.252 172.16.3.253
40 Release 12.0(1)T
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 con???guration 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 con???guration
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Examples
The following example enables DHCP services on the DHCP server:
service dhcp
42 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
Defaults
None
Command Modes
EXEC
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
If the address is not speci???ed, all address bindings are shown. Otherwise, only the binding for the speci???ed client is displayed.
Examples
The following examples show the DHCP binding address parameters, including an IP address, an associated MAC address, a lease expiration date, and the type of address assignment that have occurred. Table 2 lists descriptions of the ???elds in each example.
Router> show ip dhcp binding 172.16.1.11
Cisco IOS DHCP Server 43
Command Reference
Related Commands
clear ip dhcp binding
44 Release 12.0(1)T
show ip dhcp conflict
show ip dhcp con???ict
To display address con???icts found by a Cisco IOS Dynamic Host Configuration Protocol (DHCP) Server when addresses are offered to the client, use the show ip dhcp con???ict EXEC command.
show ip dhcp con???ict [address]
Syntax Description
Defaults
None
Command Modes
EXEC
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
The server detects con???icts using ping. The client detects con???icts using gratuitous Address Resolution Protocol (ARP). If an address con???ict is detected, the address is removed from the pool and the address will not be assigned until an administrator resolves the con???ict.
Examples
The following example displays the detection method and detection time for all IP addresses the DHCP server has offered that have con???icts with other devices. Table 3 lists descriptions of the ???elds in the example.
Router> show ip dhcp conflict
Related Commands
clear ip dhcp con???ict ip dhcp ping packets ip dhcp ping timeout
Cisco IOS DHCP Server 45
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
Defaults
If a URL is not speci???ed, all database agent records are shown. Otherwise, only information about the speci???ed agent is displayed.
Command Modes
Privileged EXEC
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Examples
The following example shows all DHCP server database agent information. Table 4 lists descriptions for each ???eld in the example.
Router# show ip dhcp database
46 Release 12.0(1)T
Related Commands
ip dhcp database
Cisco IOS DHCP Server 47
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 ???rst appeared in Cisco IOS Release 12.0(1)T.
Examples
The following example displays DHCP server statistics. Table 5 lists descriptions for each ???eld in the example.
Router> show ip dhcp server statistics
48 Release 12.0(1)T
show ip dhcp server statistics
Related Commands
clear ip dhcp server statistics
Cisco IOS DHCP Server 49
Debug Commands
Debug Commands
This section describes the following new debug command:
50 Release 12.0(1)T
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
Defaults
DHCP server debugging is not enabled.
Usage Guidelines
This command ???rst appeared in Cisco IOS Release 12.0(1)T.
Examples
The ???rst example below shows a combination of DHCP server events and decoded receptions and transmissions. The second example below shows database linkage information.
Router# debug ip dhcp server events
Router# debug ip dhcp server packets
DHCPD:DHCPDISCOVER received from client 0b07.1134.a029 through relay 10.1.0.253.
DHCPD:assigned IP address 10.1.0.3 to client 0b07.1134.a029.
DHCPD:Sending DHCPOFFER to client 0b07.1134.a029 (10.1.0.3).
DHCPD:unicasting BOOTREPLY for client 0b07.1134.a029 to relay 10.1.0.253.
DHCPD:DHCPREQUEST received from client 0b07.1134.a029.
DHCPD:Sending DHCPACK to client 0b07.1134.a029 (10.1.0.3).
DHCPD:unicasting BOOTREPLY for client 0b07.1134.a029 to relay 10.1.0.253.
DHCPD:checking for expired leases.
Router# debug ip dhcp server linkage
DHCPD:child pool:10.1.0.0 / 255.255.0.0 (subnet10.1)
DHCPD:parent pool:10.0.0.0 / 255.0.0.0 (net10)
DHCPD:child pool:10.0.0.0 / 255.0.0.0 (net10)
DHCPD:pool (net10) has no parent.
DHCPD:child pool:10.1.0.0 / 255.255.0.0 (subnet10.1)
DHCPD:parent pool:10.0.0.0 / 255.0.0.0 (net10)
DHCPD:child pool:10.0.0.0 / 255.0.0.0 (net10)
DHCPD:pool (net10) has no parent.
Related Commands
show ip dhcp bindings show ip dhcp database
Cisco IOS DHCP Server 51
Glossary
Glossary
address
address con???ict
address
database
automatic address
Dynamic Host Con???guration Protocol (DHCP)
manual address
52 Release 12.0(1)T