background image

 Cisco IOS DHCP Server 1

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.

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 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 DHSCPOFFER unicast
message.

Figure 1

DHCP Request for an IP Address from a DHCP Server

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 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.

Host A

DHCPACK (unicast)

DHCPREQUEST (broadcast)

DHCPOFFER (unicast)

DHCPDISCOVER (broadcast)

Cisco IOS

DHCP server

32369

Summary of Contents for MC3810 Series

Page 1: ...on 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 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 first offer it receives Additionally the offer from the DHC...

Page 2: ...ced 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 configuration tasks and costs Because DHCP is easy to configure it minimizes operational overhead and costs associated with device configuration ta...

Page 3: ...200 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 For descriptions of supported MIBs and how to use MIBs see the Cisco MIB web site on CCO at http www cisco com public sw center netmgmt cmtk mibs shtml RFCs RFC 951 Bootstrap Protocol BOOTP RFC 1542 Clarifications and Extension...

Page 4: ...main name should be configured at the highest network or subnetwork level of the tree Note Inherited parameters can be overridden For example if a parameter is defined in both the natural network and a subnetwork the definition of the subnetwork is used Address leases are not inherited If a lease is not specified for an IP address by default the DHCP server assigns a one day lease for the address ...

Page 5: ... You can configure a DHCP address pool with a name that is a symbolic string such as engineering or an integer such as 0 Configuring a DHCP address pool also places you in DHCP pool configuration mode identified by the config dhcp prompt from which you can configure pool parameters for example the IP subnet number and default router list To configure a DHCP address pool complete the required tasks...

Page 6: ...ce 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 configure the NetBIOS WINS servers that are available to a Microsoft DHCP client use the following command in DHCP pool configuration mode Command Purpose Router config dhcp network network nu...

Page 7: ...s 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 configure 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 Au...

Page 8: ...dentified by the config dhcp prompt 2 Router config dhcp host address mask prefix length Specifies the IP address and subnet mask of the client The prefix length specifies the number of bits that comprise the address prefix The prefix is an alternative way of specifying the network mask of the client The prefix length must be preceded by a forward slash 3 Router config dhcp hardware address hardwa...

Page 9: ...pose 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 Command Purpose Router config service dhcp Enables the Cisco IOS DHCP Server feature on your router Use the no form of this command to disable the Cisco IOS DHCP Server feature Command Purpose Router clear ip dhcp binding address D...

Page 10: ...ubnetworks 172 16 1 0 and 172 16 2 0 In each pool clients are granted 30 day leases and all addresses in each subnetwork except the excluded addresses are available to the DHCP server for assigning to clients Table 1 lists the IP addresses for the devices in three DHCP address pools Command Purpose Router show ip dhcp binding address Displays a list of all bindings created on a specific DHCP serve...

Page 11: ... default router 172 16 2 100 172 16 2 101 lease 30 Manual Bindings Configuration 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 hardware address 02c7 f800 0422 ieee802 client name Mars Because attributes are inherited the pre...

Page 12: ...tistics client identifier client name default router dns server domain name hardware address host ip dhcp conflict logging ip dhcp database ip dhcp excluded address ip dhcp ping packets ip dhcp ping timeout ip dhcp pool ip dhcp relay information check ip dhcp relay information option ip dhcp relay information policy lease netbios name server netbios node type network DHCP next server option servic...

Page 13: ...ionality 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 filter on command begin include exclude regular expression Following is an example of the show atm vc command in which you want the command output to begin with the first line where the expression PeakRate appears show atm vc begin PeakRate ...

Page 14: ...delete the boot image name bootfile filename no bootfile Syntax Description Defaults No default behavior or values Command Modes DHCP pool configuration Usage Guidelines This command first appeared in Cisco IOS Release 12 0 1 T Examples The following example specifies xllboot as the name of the boot file bootfile xllboot Related Commands ip dhcp pool next server filename Specifies the name of the ...

Page 15: ...leged 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 configuration 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 Comma...

Page 16: ...n Cisco IOS Release 12 0 1 T The server detects conflicts using a ping session The client detects conflicts using gratuitous Address Resolution Protocol ARP If the asterisk character is used as the address parameter DHCP clears all conflicts Examples The following example shows an address conflict of 10 12 1 99 being deleted from the DHCP server database clear ip dhcp conflict 10 12 1 99 Related C...

Page 17: ...yntax 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 The counters will be initialized or set to zero with this command Examples The following example resets all DHCP counters to zero clear ip dh...

Page 18: ...HCP clients require client identifiers instead of hardware addresses The client identifier is formed by concatenating the media type and the MAC address For example the Microsoft client identifier 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...

Page 19: ...me no client name Syntax Description 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 a string client1 that will be the name of the client client name client1 Related Commands host ip dhcp pool name Specifies the client s name using any standard ASCII character The client name sho...

Page 20: ...nes This command first 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 specifies 10 12 1 99 as the IP address of the d...

Page 21: ...lient cannot correlate host names to IP addresses Command Modes DHCP pool configuration Usage Guidelines This command first 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 specifies 10 12 1 99 as the IP address of the domain name server of the c...

Page 22: ...command to remove the domain name domain name domain no domain name Syntax Description 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 com as the domain name of the client domain name cisco com Related Commands dns server ip dhcp pool domain Specifies the client s domain na...

Page 23: ... if none is specified Command Modes DHCP pool configuration Usage Guidelines This command first appeared in Cisco IOS Release 12 0 1 T Examples The following example specifies b708 1388 f166 as the MAC address of the client hardware address b708 1388 f166 Related Commands client identifier host ip dhcp pool hardware address Specifies the MAC address of the client s hardware platform type Indicates...

Page 24: ... 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 configure one manual binding per host pool Examples The following example specifies 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 client identifier ha...

Page 25: ...bled Command Modes Global configuration Usage Guidelines This command first 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 conflict logging command to disable the recording of address conflicts By default the Cisco IOS DHCP Ser...

Page 26: ...Protocol TFTP or remote copy protocol RCP Example The following example specifies the DHCP database transfer timeout value at 80 seconds ip dhcp database ftp user password 172 16 1 1 router dhcp timeout 80 The following example specifies the DHCP database update delay value at 100 seconds ip dhcp database tftp 172 16 1 1 router dhcp write delay 100 url Specifies the remote file used to store the a...

Page 27: ...ip dhcp database Cisco IOS DHCP Server 27 Related Commands show ip dhcp database ...

Page 28: ...IP pool addresses are assignable Command Modes Global configuration Usage Guidelines This command first 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 configures an excluded IP address range from 172 16 1 100 through 172 16 1 19...

Page 29: ...e Guidelines This command first 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 specifies five ping attempts by the DHCP server before ...

Page 30: ...guration Usage Guidelines This command first appeared in Cisco IOS Release 12 0 1 T This command specifies how long to wait for a ping reply in milliseconds Examples The following example specifies 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 conflicts ip dhcp ping packets show ip dhcp...

Page 31: ... not configured Command Modes Global configuration Usage Guidelines This command first appeared in Cisco IOS Release 12 0 1 T During execution the configuration mode changes to DHCP pool configuration mode identified by the config dhcp prompt In this mode the administrator can configure pool parameters like the IP subnet number and default router list Examples The following example configures pool...

Page 32: ...Description This command has no arguments or keywords Defaults The DHCP server checks relay information Invalid messages are dropped Command Modes Global configuration Usage Guidelines This command first 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 ...

Page 33: ...ormation 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 configuration Usage Guidelines This command first 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...

Page 34: ...able 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 configure a DHCP relay agent to drop messages with existing relay information keep existing information and replace existing info...

Page 35: ... 12 0 1 T Examples The following example shows a one day lease lease 1 The following example shows a one hour lease lease 0 1 The following example shows a one minute lease lease 0 0 1 The following example shows an infinite unlimited lease lease infinite Related Commands ip dhcp pool days Specifies the duration of the lease in numbers of days hours Optional Specifies the number of hours in the le...

Page 36: ...on Defaults None Command Modes DHCP pool configuration Usage Guidelines This command first 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 specifies th...

Page 37: ...type type no netbios node type Syntax Description Defaults None Command Modes DHCP pool configuration Usage Guidelines This command first appeared in Cisco IOS Release 12 0 1 T The recommended type is h node hybrid Examples The following example specifies the client s NetBIOS type as hybrid netbios node type h node Related Commands ip dhcp pool netbios name server type Specifies the NetBIOS node t...

Page 38: ... all host addresses are available The system administrator can exclude subsets of the address space by using the ip dhcp excluded address command You can not configure manual bindings within the same pool that is configured with the network command Examples The following example configures 172 16 0 0 16 as the DHCP pool s subnetwork number and mask network 172 16 0 0 16 Related Commands host ip dh...

Page 39: ...s DHCP pool configuration Usage Guidelines This command first 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 specifies 10 12 1 99 as the IP address of the next server in the boot process next serv...

Page 40: ...ed in RFC 2131 Dynamic Host Configuration Protocol Examples The following example configures DHCP option 19 which specifies whether the client should configure 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 configures DHCP option 72 which spe...

Page 41: ...option Cisco IOS DHCP Server 41 Related Commands ip dhcp pool ...

Page 42: ...d 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 Examples The following example enables DHCP services on the DHCP server service dhcp ...

Page 43: ...ype of address assignment that have occurred Table 2 lists descriptions of the fields in each example Router show ip dhcp binding 172 16 1 11 IP address Hardware address Lease expiration Type 172 16 1 11 00a0 9802 32de Feb 01 1998 12 00 AM Automatic Router show ip dhcp binding 172 16 3 254 IP address Hardware address Lease expiration Type 172 16 2 254 02c7 f800 0422 Infinite Manual address Optiona...

Page 44: ...Command Reference 44 Release 12 0 1 T Related Commands clear ip dhcp binding ...

Page 45: ...olves the conflict Examples The following example displays the detection method and detection time for all IP addresses the DHCP server has offered that have conflicts with other devices Table 3 lists descriptions of the fields in the example Router show ip dhcp conflict IP address Detection Method Detection time 172 16 1 32 Ping Feb 16 1998 12 28 PM 172 16 1 64 Gratuitous ARP Feb 23 1998 08 12 AM...

Page 46: ...gent information Table 4 lists descriptions for each field in the example Router show ip dhcp database URL ftp user password 172 16 4 253 router dhcp Read Dec 01 1997 12 01 AM Written Never Status Last read succeeded Bindings have been loaded in RAM Delay 300 seconds Timeout 300 seconds Failures 0 Successes 1 url Optional Specifies the remote file used to store automatic DHCP bindings Following ar...

Page 47: ...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 Successes The number of successful file transfers Table 4 show ip dhcp database Field Descriptions continued Field Description ...

Page 48: ...ge Guidelines This command first appeared in Cisco IOS Release 12 0 1 T Examples The following example displays DHCP server statistics Table 5 lists descriptions for each field in the example Router show ip dhcp server statistics Memory usage 40392 Address pools 3 Database agents 1 Automatic bindings 190 Manual bindings 1 Expired bindings 3 Malformed messages 0 Message Received BOOTREQUEST 12 DHCP...

Page 49: ...e number of IP addresses that have been automatically mapped to the MAC addresses of hosts that are found in the DHCP database Manual bindings The number of IP addresses that have been manually mapped to the MAC addresses of hosts that are found in the DHCP database Expired bindings The number of expired leases Malformed messages The number of truncated or corrupted messages that were received by ...

Page 50: ...Debug Commands 50 Release 12 0 1 T Debug Commands This section describes the following new debug command debug ip dhcp server ...

Page 51: ... 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 de...

Page 52: ...d in the Internet for translating names of network nodes into addresses automatic address allocation An address assignment method where a network administrator obtains an IP address for a client for a finite period of time or until the client explicitly relinquishes the address Automatic allocation is particularly useful for assigning an address to a client that will be connected to the network on...

Reviews: