Полезная информация

cc/td/doc/product/software/ios120/120newft/120t
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

Cisco IOS DHCP Server

Feature Summary

Platforms

Prerequisites

Supported MIBs and RFCs

Functional Description

Configuration Tasks

Configuration Examples

Command Reference

What to Do Next

Cisco IOS DHCP Server

Feature Summary

With the introduction of Cisco IOS Easy IP Phase 2, Cisco IOS software supports Cisco IOS Dynamic Host Control Protocol (DHCP) Server functionality. DHCP is a protocol that enables you to automatically assign reusable IP addresses to clients. Cisco IOS DHCP server is a full DHCP server implementation that assigns and manages IP addresses from specified address pools within the router to DHCP hosts. For a complete list of supported DHCP options, see Table 1 in the "Functional Description" section. For more specific information about DHCP concepts, see RFC 2131. For information about DHCP options, see RFC 2132.

Also, Cisco IOS Easy IP Phase 2 supports DHCP Relay Agent functionality. A DHCP relay agent is any host that forwards DHCP packets between clients and servers with the goal of automatically assigning an IP address and address parameters to a client requesting an address. A DHCP relay agent enables the client and server to reside on separate subnets. If the Cisco IOS DHCP server cannot satisfy a DHCP request from its own database, it can forward the DHCP request to one or more secondary DHCP servers defined by the network administrator.

Figure 1 shows the initial steps that occur in the process of a client being assigned an IP address. The client, Host A, sends a DHCP request to the Cisco IOS DHCP server, using dhcpdiscover, which is a broadcast message requesting an IP address. Cisco IOS DHCP server then sends the request along to a remote central DHCP server.


Figure 1: DHCP Request for an IP Address from a Central DHCP Server


Figure 2 shows the response of the Cisco IOS DHCP server. Using the dhcpoffer message, the Cisco IOS DHCP Server sends a unicast message to the client, offering address parameters, typically an IP address, a MAC address, a domain name, and a lease on the address. The client can accept or reject the address parameters. The client responds by sending a dhcprequest message. The server sends a dhcpack to confirm acceptance.


Figure 2: Central DHCP Server Granting an IP Address to a Remote Client


Benefits

Cisco IOS DHCP server offers the following benefits:

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.
DHCP enables Internet service providers (ISPs) to allocate a single registered IP address to each remote LAN. Because only a single registered IP address is required to provide global Internet access to all users on an entire remote LAN, customers and ISPs can use their registered IP addresses more efficiently.
Because DHCP is easy to configure, it minimizes operational overhead and costs associated with device configuration tasks and eases deployment by non-technical users.
Hosts in remote offices can obtain dynamic IP addresses directly from the remote office router via the Cisco IOS DHCP server, eliminating the need to configure and maintain a separate and standalone DHCP server in the remote office.

List of Terms

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. During address assignment, DHCP checks for conflicts using ping and gratuitous ARP. If a conflict is detected, the address is removed from the pool. The address will not be assigned until the administrator resolves the conflict.

address pool---The range of IP addresses assigned by the DHCP server. Address pools are indexed by subnet number.

automatic address allocation---An address assignment method that assigns a permanent IP address to a host, using an infinite IP address lease period.

client---Any host requesting configuration parameters.

database---A collection of address pools.

database agent---Any host storing the DHCP bindings database, for example a server.

DNS---Domain Name System. A system used in the Internet for translating names of network nodes into addresses.

dynamic 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. Dynamic allocation is particularly useful for assigning an address to a client that will be connected to the network only temporarily or for sharing a limited pool of IP addresses among a group of clients that do not need permanent IP addresses. Dynamic allocation may also be a good choice for assigning an IP address to a new client being permanently connected to a network where IP addresses are sufficiently scarce that it is important to reclaim them when old clients are retired.

Dynamic Host Configuration Protocol (DHCP)---A protocol that provides a mechanism for allocating IP addresses dynamically so that addresses can be reused when hosts no longer need them.

manual address allocation---An address assignment method that allocates an administratively assigned IP address to a host. Manual allocation allows DHCP to be used to eliminate the error-prone process of manually configuring hosts with IP addresses.

server---Any host providing configuration parameters.

Platforms

This feature is supported on the following routers and access servers:

This feature is supported on the following routers and access servers:

Prerequisites

Before configuring the Cisco IOS DHCP server, perform the following tasks:

Supported MIBs and RFCs

This feature supports the following RFCs:

No new MIBs are supported with this feature.

Functional Description

DHCP is divided up into eight message types that indicate several tasks to occur. They are described in Table 1.


Table 1: DHCP Messages
DHCP Message Description

dhcpdiscover

A broadcast message sent by the client, requesting an address.

dhcpoffer

A unicast message sent by the DHCP server to the client, offering address parameters, typically an IP address, a MAC address, a Domain Name, and a lease on the address.

dhcprequest

A message by the client indicating it has accepted the address parameters offer.

dhcpdecline

A message by the client indicating it has rejected the address parameters offer because of an address conflict.

dhcpack

A message by the DHCP server indicating that a binding has been created for the IP address and MAC address sent to the client. A binding is a technique that maps together the MAC address and the IP address of a client.

dhcpinform

A message by the client indicating the IP address is already configured, but requesting other parameters need to be assigned, for example, the Domain Name.

dhcprelease

A message sent by the client that indicates a premature termination of the IP address lease.

dhcpnak

A message by the Cisco IOS DHCP server indicating that the IP address used could not restart.

The DHCP message sequence occurs as shown in Table 2.


Table 2: DHCP Message Sequence
Step Task Message Issued

1 . 

A client sends out a broadcast, requesting an address.

dhcpdiscover indicates the client needs an address.

2 . 

The server unicasts an offer that includes an IP address, a lease date and other parameters (for example, a domain name) to the client.

dhcpoffer offers an address to the client.

3 . 

The client can either issue an acceptance or rejection of the address offer.

dhcprequest accepts one address offer and rejects all others.

dhcpdecline indicates the client detected another node is using the offered address.

4 . 

If the client accepts the address offer, a binding is created.

The server sends dhcpack, binding the client MAC address with the assigned IP address and the Lease Expiration date. The default lease is one day, although the lease date can be any amount of time.

5 . 

The client is operating with a valid IP address. The DHCP messaging is complete until half the lease expires. At that point, the client attempts to renew the lease.

When working with an RFC, you can call out functionality from the commands by referring to the option number that links up with the command feature. For example, instead of asking for the host command that retrieves a subnet mask, you can simply specify the number 1, indicating the value for the subnet mask. Option numbers are shown in Table 3.


Table 3: DHCP Options
DHCP Option Name DHCP Option Code Description

Subnet Mask Option

1

Specifies the client's subnet mask as designated in RFC 950. Subnet masks are 32-bit combination used to indicate the portion of an IP address that are being used for the subnet address.

Router Option

3

Specifies a list of IP addresses for routers to the client.

Domain Name Server Option

6

Specifies a list of Domain Name Servers available to the client.

Host Name Option

12

Specifies the name of the client. The name may contain any standard ASCII character and be up to 32 characters long. The name may or may not be qualified with the local domain name.

Domain Name Option

15

Specifies the domain name that the client should use when resolving hostnames via the Domain Name System.

NetBIOS over TCP/IP Name Server Option

44

Specifies a list of RFC 1001/1002 NetBIOS name servers.

NetBIOS over TCP/IP Node Type Option

46

Enables NetBIOS over TCP/IP clients to be configured as described in RFC 1001/1002. Valid node types are

B---Broadcast node

P---Peer-to-peer node

M---Mixed node

H---Hybrid

IP Address Lease Time Option

51

Allows the client to request a lease time for the IP address. Used as part of a client request (dhcpdiscover or dhcprequest). In a server reply (dhcpoffer), a DHCP server uses this option to specify the lease time it is willing to offer.

DCHP Message Type Option

53

Conveys the DHCP message type. Values for this option are:

dhcpdiscover

dhcpoffer

dhcprequest

dhcpdecline

dhcpack

dhcpnak

dhcprelease

dhcpinform

For definitions of these, see the DHCP message table.

Server Identifier Option

54

Identifies the IP address of the selected DHCP server. This address is used in dhcpoffer and dhcprequest messages, and may optionally be included in the dhcpack and dhcpnak messages.

DHCP servers nclude this option in the dhcpoffer message in order to allow the client to distinguish between lease offers.

DHCP clients use the contents of the Server Identifier field as the destination address for any DHCP messages unicast to the DHCP server. DHCP clients also indicate which of several lease offers are being accepted by including this option in a dhcprequest message.

Renewal (T1) Time Option

58

Specifies the time interval from address assignment until the client transitions to the renewing state. At the time the T1 client sends (via unicast) a dhcprequest message to the server to extends its lease.

Rebinding (T2) Time Option

59

Specifies the time interval from address assignment until the client transitions to the rebinding state and sends (via broadcast) a dhcprequest message any DHCP server to extends its lease.

Intelligent DHCP Relay and Secondary Address Pools

With the introduction of Cisco IOS Easy IP Phase 2, Cisco IOS software also supports intelligent DHCP Relay functionality. A DHCP relay agent is any host that forwards DHCP packets between clients and servers. If the DHCP relay agent sees several DHCP retransmissions, it assumes that the DHCP server is not responding because of an exhausted address pool. The intelligent DHCP Relay feature forces the downstream DHCP server to attempt to allocate an IP address from a different pool. This makes it possible for the client to boot with an IP address from a secondary address pool if the primary pool is depleted.

Unique Address Allocation

To prevent assigning addresses to clients that may already be in use, the Cisco IOS DHCP server issues ICMP echo requests to pool addresses before assigning them to clients. The Cisco IOS DHCP server pings for potential IP address conflicts. If the pings are unanswered within a configured timeout period, the Cisco IOS Server determines that the address is not in use. The server then assigns the address to the requesting client. If an address conflict is detected, the Cisco IOS DHCP server removes the offending address from the pool. The address will not be assigned until the administrator resolves the conflict.

Configuration Tasks

This section describes Cisco IOS DHCP server configuration tasks:

Specify a DHCP Server Boot File

The boot file 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 bootfile for the DHCP server, use the following command in DHCP pool configuration mode:
Command Purpose

bootfile filename

Specify the name of the boot file that contains the image of the operating system the client loads.

Specify the Client's Identifier

The client's identifier is a field that identifies the client on the subnet for binding lookups. It generally consists of a MAC address and a media type code. To specify a client identifier string, use the following command in DHCP pool configuration mode:
Command Purpose

client-identifier unique-identifier

Create a string used to identify the client during binding lookups instead of using a MAC address.

Specify the Client's Name

The client can have a name that can be referenced in binding lookups instead of an IP address. To specify a name for the client, use the following command in DHCP pool configuration mode:
Command Purpose

client-name name

Create a string that identifies the client by name instead of IP address.

Specify the Default Router

The default router is the router the DHCP client sends packets to once it has booted. It is the router that is nearest to the client on the network. To specify a default router for the client, use the following command in DHCP pool configuration mode:
Command Purpose

default-router address [address2 ... address8]

Identify the address of the router that the DHCP client will send packets to once it has been booted.

Specify Domain Name IP Servers Available to the Client

When the client needs to identify a name of a DHCP server, it converts the IP address to a server name. To specify the domain name IP servers available to the client, use the following command in DHCP pool configuration mode:
Command Purpose

dns-server address [address2 ... address8]

Specify the IP addresses of DHCP servers available to the client.

Enable DHCP Server Debugging

You can enable DHCP server debugging that allows you to view activity on the DHCP server. The activity can take the form of packets, which are messages the server receives; events, which are timeouts when leases expire; and linkages, which are debugging occurrences that attribute inheritance. To enable DHCP server debugging, use the following command in EXEC mode:
Command Purpose

debug ip dhcp server {events | packets | linkage}

Enable debugging on the DHCP server.

Specify a Domain Name for the Client

You can create a domain name string for the client. To create a domain name string for the client, use the following command in DHCP pool configuration mode:
Command Purpose

domain-name domain

Specify the client's domain name.

Specify the Client's Hardware Address

You can specify the client's hardware address when you perform a binding lookup. The hardware address is generally the MAC address, although it can be any hexadcimal string. To specify the client's hardware address, use the following command in DHCP pool configuration mode:
Command Purpose

hardware-address hardware-address type

Create a hardware address for the client.

Specify the Client's IP Address

You can set the client's IP address, subnet mask, and prefix length. To specify the client's IP address, use the following command in DHCP pool configuration mode:
Command Purpose

host address [mask network-mask | prefix-length bits]

Set the client's IP address, subnet mask, and prefix length.

Specify the Database Agent Parameters

The DHCP database agent is any host storing the DHCP bindings database, for example a server. You can set the interval between database updates before the agent transmits database changes. You can also set the interval between database transfers. To specify the database agent parameters, use the following command in DHCP pool configuration mode:
Command Purpose

ip dhcp database url {write-delay seconds | timeout seconds}

Set the interval between database updates and database transfers.

Specify IP Addresses not Assigned by the DHCP Server

To specify IP addresses not assigned by the DHCP server, use the following command in DHCP pool configuration mode:
Command Purpose

ip dhcp ping packets count

Specify IP addresses to the client which have not been assigned by the DHCP server by tracking which addresses do not reply to the ping.

Specify How Long to Wait for a Ping Reply

You can ping a client's address before you assign an address to another client to determine a potential address conflict. To specify how many packets the DHCP server should send to the client during the ping, use the following command in global configuration mode:
Command Purpose

ip dhcp ping packets count

Specify how many packets the DHCP server sends to the client when a ping is executed.

Specify the Duration of a Ping Timeout

You can specify the amount of time that elapses after the DHCP server issues a ping to the client before the ping stops attempting to make contact and times out. To specify the amount of time that passes before a ping request times out, use the following command in global configuration mode:
Command Purpose

ip dhcp ping timeout milliseconds

Specify the amount of time that elapses after the DHCP server issues a ping to the client before the server stops attempting to make contact with the client.

Create an Address Pool Name

Address pools contain available IP addresses that the DHCP server can use to assign to a client requesting an address. Typically, address pools are referenced by IP addresses and subnet masks. You can assign a name to an address pool. To assign a name to an address pool, use the following command in global configuration mode:
Command Purpose

ip dhcp pool name

Create a name for the a DHCP server address pool.

Determine Whether Relay Agent Information Option is Correct

You can determine whether relay information option information is correct. To determine whether relay agent information option is correct, use the following command in global configuration mode:
Command Purpose

ip dhcp relay information check

Determine whether the relay agent information option is correct.

Define the Relay Information Reforwarding Policy

If a relay
Command Purpose

ip dhcp relay information policy {drop | keep | replace}

Determine the relay information reforwarding policy in a cable modem termination system.

Specify the Address Lease Time

Each address assigned by the DHCP server comes with a lease value or the amount of time for which the address is valid. You can define the duration of this time, using the lease command. To define the duration of the lease period associated with an address, use the following command in DHCP pool configuration mode:
Command Purpose

lease {days [hours][minutes]| infinite}

Define the duration of the lease time.

Specify the NetBIOS Name Servers Available to the Client

You can perform name resolution for NetBIOS name servers. To specify the name of the NetBIOS name servers available to the client, use the following command in DHCP pool configuration mode:
Command Purpose

netbios-name-server address [address2 ... address8]

Create a name for the NetBIOS server(s) available to the client.

Select the Client's NetBIOS Node Type

The NetBIOS node type for the client can be one of four settings: broadcast, peer-to-peer, mixed, or hybrid. To specify the type of NetBIOS node you want, use the following command in DHCP pool configuration mode:
Command Purpose

netbios-node-type type

Select the NetBIOS node type for the client.

Enable DHCP Services on the DHCP Server

DHCP has a series of services associated with it. Well known services are Telnet and rlogin. The services are disabled by default. To enable DHCP services on the DHCP server, use the following command in DHCP pool configuration mode:
Command Purpose

service dhcp

Enable DHCP services on the DHCP server.

Monitor and Maintain the Cisco IOS DHCP Server

You can perform the tasks in the following sections to monitor and maintain the server:

Display Address Bindings on the DHCP Server

The DHCP server contains a list of all the bindings it has created for clients. To display a list of all bindings created on a specific DHCP server, use the following command in EXEC configuration mode:
Command Purpose

show ip dhcp binding address

Display a list of all bindings created on a specific DHCP server.

Display Address Conflicts on the DHCP Server

The DHCP server contains a list of all address conflicts that have occurred when the server has tried to assign IP addresses to clients. To display a list of all address conflicts recorded by the DHCP server, use the following command in EXEC configuration mode:
Command Purpose

show ip dhcp conflict address

Display a list of all address conflicts recorded by a specific DHCP server.

Display DHCP Database Information

The DHCP database contains various types of information about the activity recorded on the DHCP server. You can display information from the server database about:

To display information from the DHCP database, use the following command in EXEC configuration mode:
Command Purpose

show ip dhcp database url

Display recent activity on the DHCP database.

Display DHCP Server Statistics

The DHCP server contains count information about certain kinds of statistics on the server. The statistic types are:

The DHCP server also contains count information about various message types that have been received and sent. To display count information about server statistics and messages sent and received, use the following command in EXEC configuration mode:
Command Purpose

show ip dhcp server statistics

Display count informaton about server statistics and messges sent and received.

Clear Information

You can clear several variables being set by using various clear commands. To clear variables, use the following commands in EXEC configuration mode:
Command Purpose

clear ip dhcp binding address

Delete an automatic address binding from the DHCP database.

clear ip dhcp conflict address

Clear an address conflict.

clear ip dhcp server statistics

Reset all DHCP server counters to 0.

Configuration Examples

This section provides the following Cisco IOS DHCP server examples:

Client Bootfile Name Example

The following example specifies the name of the client bootfile as routfile:

router(config-dhcp)# bootfile routfile

Client MAC Address Example

The following example specifies the client's MAC address (01b7.0813.8811.66) in dotted-hexadecimal notation:

router(config-dhcp)# client-identifier 01b7.0813.8811.66

Client Name Example

The following example specifies the string client1 as the name of the client:

router(config-dhcp)# client-name client1

Default Router Example

The following example specifies the IP address of the default router as 10.12.1.99:

router(config-dhcp)# default-router 10.12.1.99

Client Domain Name Server IP Address Example

The following example specifies the IP address of the Domain Name Server of the client as 10.12.1.99:

router(config-dhcp)# dns-server 10.12.1.99

Client Domain Name Server Name Example

The following example specifies the domain name of the client as cisco.com:

router(config-dhcp)# domain-name cisco.com

Client Hardware Address Example

The following example specifies the MAC address of the client as b708.1388.f166:

router(config-dhcp)# hardware-address b708.1388.f166

Client IP Address and Subnet Mask Example

The following example specifies the client's IP address as 10.12.1.99 and subnet mask as 255.255.248.0:

router(config-dhcp)# host 10.12.1.99 255.255.248.0

DHCP Database Values Example

The following example specifies the DHCP database router1 update delay value as 80 seconds:

router(config-dhcp)#ip dhcp database http://router1  write-delay 80

The following example specifies the DHCP database router1 transfer timeout value as 100 seconds:

router(config-dhcp)#ip dhcp database http://router1  timeout 100

Ping Packet Number Example

The following example specifies the number of ping attempts that are made by the DHCP server to all hosts on the network before ceasing any further ping attempts as 20 times:

router# ip dhcp ping packets 20

DHCP Server Ping Timeout Example

The following example specifies the number of milliseconds 800 that the DHCP server will wait for a ping reply before considering the ping a failure:

router# ip dhcp ping timeout 800

Address Pool Name Example

The following example specifies the string used for the address pool created as pool1:

router# ip dhcp pool pool1

Address Lease Time Limit Example

The following example shows a one-day lease:

router(config-dhcp)# lease 1 

The following example shows a one-hour lease:

router(config-dhcp)# lease 0 1 1 hour

The following example shows a one-minute lease:

router(config-dhcp)# lease 0 0 1 1 minute

The following example shows an infinite lease:

router(config-dhcp)# lease infinite

NetBIOS Name Servers Example

The following example specifies the IP address of a NetBIOS name server available to the client as 10.12.1.90:

router(config-dhcp)# netbios-name-server 10.12.1.90

Client NetBIOS Node Type Example

The following example specifies the client's NetBIOS type as h-node:

router(config-dhcp)# netbios node-type h-node

Monitor and Maintain Cisco IOS DHCP Server Examples

This section provides the following monitoring and maintaining Cisco IOS DHCP server examples:

DHCP Binding Address Parameters Example

The following example displays the dhcp binding address parameters, including an IP address (144.1.1.11), an associated MAC address (00a0.9802.32de), a lease expiration date (Feb 01 1998), and the type of address assignment (automatic) that has occurred:

router> show ip dhcp binding 144.1.1.11
IP address	Hardware address				Lease expiration			Type
144.1.1.11	00a0.9802.32de					Feb 01 1998 12:00 AM			Automatic
 
router> show ip dhcp binding 144.1.3.254
IP address	Hardware address					Lease expiration			Type
144.1.2.254	02c7.f800.0422					Infinite			Manual

DHCP Conflicts Example

The following example displays the detection method, for example, ping or gratuitous ARP, and Detection Time (Feb 16 1998 for 144.1.1.32) for all IP addresses the DHCP server has offered that have conflicts with other devices:

router> show ip dhcp binding conflict 10.12.1.99
IP address			Detection Method			Detection time
144.1.1.32	Ping					Feb 16 1998	12:28 PM
144.1.1.64	Gratuitous ARP					Feb 23 1998	08:12 AM	

Database Agent Information Example

The following example shows values of variables in the dhcp database:

router> show ip dhcp database
URL			:	ftp://user:password@144.1.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

DHCP Server Statistics Example

The following example shows values of DHCP server statistics.

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
DHCPDISCOVER					200
DHCPREQUEST					178
DHCPDECLINE					0
DHCPRELEASE					0
DHCPINFORM					0
 
Message					Sent
BOOTREPLY					12
DHCPOFFER					190
DHCPACK					172
DHCPNAK					6

Deleting Client Address Binding Example

The following example shows an address binding being deleted from a client:

router> clear ip dhcp binding 10.12.1.99

Deleting an Address Conflict from the DHCP Server Database Example

The following example shows an address conflict being deleted from the DHCP server database:

router> clear ip dhcp conflict 10.12.1.99

Command Reference

This section documents the following new or modified commands. All other commands used with this feature are documented in the Cisco IOS Release 12.0 command references.

bootfile

To specify the name of the default boot imageon the server, use the bootfile DHCP pool command. Use the no form of this command to delete the boot image name.

bootfile filename
no bootfile filename

Syntax Description

filename

Specifies the name of the default firmware file used as a boot image.

Default

The default filename is 12.0(1)T

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies routfile as the name of the client bootfile.

router(config-dhcp)# bootfile routfile

clear ip dhcp binding

To delete an automatic address binding from the DHCP database, use the clear ip dhcp binding EXEC command. Typically, the address denotes the client's IP address. If the * character is used as the address parameter, DHCP clears all automatic bindings.

clear ip dhcp binding address

Syntax Description

address

The address of the binding you want to clear.

Command Mode

Privileged EXEC

Usage Guidelines

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.

Example

The following example shows the address binding with an IP address of 10.12.1.99 being deleted from a client:

router# clear ip dhcp binding 10.12.1.99

clear ip dhcp conflict

To clear an address conflict, use the clear ip dhcp conflict EXEC command. The server detects conflicts using a ping session. The client detects conflicts using gratuitous ARP. If the * character is used as the address parameter, DHCP clears all conflicts.

clear ip dhcp conflict address

Syntax Description

address

The address of the host that contains the conflicting address you want to clear.

Command Mode

Privileged EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example shows an address conflict of 10.12.1.99 being deleted from the DHCP server database:

router# clear ip dhcp conflict 10.12.1.99

clear ip dhcp server statistics

To reset all DHCP counters, use the clear ip dhcp server statistics EXEC command. The command show ip dhcp server statistics displays DHCP counters.

clear ip dhcp server statistics

Syntax Description

This command has no arguments or keywords.

Default

All counters are cumulative. In other words, they increment from the value recorded in the most recent session initiated by the show ip dhcp server statistics command. The counters will be initialized, or set to zero, with this command.

Command Mode

Privileged EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

client-identifier

To specify the client's MAC address or unique identifier (in dotted-hexadecimal notation), use the client-identifier DHCP pool command. It is valid for host pools only. Use the no form of this command to delete the client identifier.

client-identifier unique-identifier
no client-identifier unique-identifier

Syntax Description

unique-identifier

The distinct identification of the client in dotted-hexadecimal notation, for example, 01b7.0813.8811.66.

Default

None

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies 01b7.0813.8811.66 as the client's MAC address (01b7.0813.8811.66) in dotted-hexadecimal notation:

router(config-dhcp)# client-identifier 01b7.0813.8811.66

client-name

To specify the client's name, use the client-name DHCP pool 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 name

Syntax Description

name

Specifies the client's name, using any standard ASCII character. The string can be up to 32 characters long. The client name should not include the domain name. For example, the name mars should not be specified as mars.planet.org.

Default

None

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies a string client1 that will be the name of the client:

router(config-dhcp)# client-name client1

debug ip dhcp server

To enable DHCP server debugging, use the debug ip dhcp server EXEC command.

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.

linkage

Displays database linkage information (such as parent-child relationships in a radix tree).

Default

Disabled by default.

Command Mode

Privileged EXEC

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

default-router

To specify the default router list for the client, use the default-router DHCP pool command. You can specify up to seven 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.) Use the no form of this command to remove the default router list. The IP address should be on the same subnet as the client subnet.

default-router address [address2 ... address8]
no default-router address [address2 ... address8]

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.

Default

The default router has no default address.

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies 10.12.1.99 as the IP address of the default router:

router(config-dhcp)# default-router 10.12.1.99

dns-server

To specify the domain name IP servers available to the client, use the dns-server DHCP pool command. Servers are listed in order of preference (address1 is the most preferred router, address2 is the next most preferred router, and so on.) Use the no form of this command to remove the DNS server list.

dns-server address [address2 ... address8]
no dns-server
address [address2 ... address8]

Syntax Description

address

Specifies the IP address of a domain name server. One IP address is required, although you can specify up to eight addresses in one command line.

Default

None

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies 10.12.1.99 as the IP address of the Domain Name Server of the client:

router(config-dhcp)# dns-server 10.12.1.99

domain-name

To specify the client's domain name or name of a network node, use the domain-name DHCP pool command. Use the no form of this command to remove the domain name.

domain-name domain
no domain-name domain

Syntax Description

domain

Specifies the client's domain name string. The string can be composed of any standard ASCII character and can be up to 32 characters long.

Default

None

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies cisco.com as the domain name of the client:

router(config-dhcp)# domain-name cisco.com

hardware-address

To specify the client's hardware address, use the hardware-address DHCP pool command. It is valid for host pools only. Use the no form of this command to remove the hardware address.

hardware-address hardware-address type
no hardware-address hardware-address type

Syntax Description

  • hardware-address

  • Specifies the IP address of the client's hardware platform.

  • type

  • Indicates the protocol of the hardware platform. Strings and values are acceptable. The string options are:

  • ethernet

  • ieee802

  • The value options are:

  • 1 10Mb Ethernet

  • 6 IEEE 802

  • If no type is specified, the default protocol is Ethernet.

Default

Ethernet is the default type if none is specified.

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies b708.1388.f166 as the MAC address of the client:

router(config-dhcp)# hardware-address b708.1388.f166

host

To specify the client's IP address and network mask, use the host DHCP pool command. If the mask and prefix length are unspecified, 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 host pools only. Use the no form of this command to remove the client's IP address.

host address [mask network-mask | prefix-length bits]
no host address [mask network-mask | prefix-length bits]

Syntax Description

address

Specifies the IP address of the client.

mask network-mask

(Optional) Specifies the network mask of the client.

prefix-length bits

(Optional) Specifies the number of bits that comprise the address prefix.

Default

None

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies 10.12.1.99 as the client's IP address and 255.255.248.0 as the subnet mask:

router(config-dhcp)# host 10.12.1.99 255.255.248.0

ip dhcp database

To specify database agent parameters, use the ip dhcp database global configuration command. The administrator may configure multiple database agents. The URL is an FTP, TFTP, or RCP uniform resource locator. Use the no form of this command to remove the database agent.

ip dhcp database url {write-delay seconds | timeout seconds}
no ip dhcp database
url {write-delay seconds | timeout seconds}

Syntax Description

url

The name or the web address of the DHCP server.

write-delay

Specifies how soon DHCP sends database updates. By default, DHCP waits 300 seconds (five minutes) before transmitting database changes. The minimum delay is 60 seconds.

timeout

Specifies how long to wait for a database transfer. Transfers that exceed the timeout period are aborted. By default, DHCP waits 300 seconds before aborting a database transfer. Infinity is defined as zero seconds.

This command has no arguments or keywords.

Default

DHCP waits 300 seconds for both a write-delay and a timeout.

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies the DHCP database update delay value and the DHCP database transfer timeout value at 80 seconds:

router# ip dhcp database http://router1  timeout 80
 

The following example specifies the DHCP database transfer timeout value at 100 seconds:

router# IP dhcp database http://router1  write-delay100

ip dhcp ping packets

To specify IP addresses to the client which have not been assigned by the DHCP server, use the ip dhcp ping packets global configuration command. The DHCP server pings a pool address before assigning it to a client. If the ping is unanswered, DHCP assumes (with a high probability) that the address is not in use. The server then assigns the address to the requesting client. 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 count

Syntax Description

count

Indicates how many pings are sent before giving up. The default value is two transmissions.

Default

Two transmissions

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies 20 ping attempts by the DHCP server before ceasing any further ping attempts:

router# ip dhcp ping packets 20

ip dhcp ping timeout

To specify how long the DHCP server has to wait for a ping reply from an address pool, use the ip dhcp ping timeout global configuration command. This command specifies how long to wait for a ping reply in milliseconds. 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 milliseconds

Syntax Description

milliseconds

The amount of time in milliseconds it takes for a ping reply to stop attempting to reach a pool address for client assignment. The maximum timeout is 10000 milliseconds (10 seconds). The default timeout is 500 milliseconds.

Default

The default timeout is 500 milliseconds.

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies the number of milliseconds 800, that the DHCP server will wait for a ping reply before considering the ping a failure:

router# ip dhcp ping timeout 800

ip dhcp pool

To create an address pool from which the dhcp ping packets command can ping a pool address before assigning it to a client, use the ip dhcp pool global configuration command. During execution, the configuration mode changes to DHCP pool configuration mode, identified by (config-dhcp)#. In this mode, the administrator can configure pool parameters, like the IP subnet number and default router list. 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).

Default

None

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies pool1 as the string used for the address pool created:

router(config-dhcp)# ip dhcp pool pool1

ip dhcp relay information check

To specify whether the relay agent information option is validated in bootreply messages, use the ip dhcp relay information check global configuration command. This command is used by cable modem termination systems. By default, DHCP checks relay information. Invalid messages are dropped. 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.

Default

DHCP checks relay information. Invalid messages are dropped.

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

ip dhcp relay information option

To specify whether the relay agent information option is added to forwarded bootrequest messages, use the ip dhcp relay information option global configuration command. This command is used by cable modem termination systems. By default, DHCP does not insert relay information. 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.

Default

DHCP does not insert relay information.

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

ip dhcp relay information policy

To define the relay information reforwarding policy, use the ip dhcp rellay information policy global configuration command. This command is used by cable modem termination systems. Typically, the address denotes the client's IP address. If the * character is used as the address parameter, DHCP clears all automatic bindings. 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 {drop | keep | replace}

Syntax Description

drop

Directs DHCP relay agent to discard messages with existing relay informationif the relay information option is already present.

keep

Indicates that existing information is left unchanged on the DHCP relay agent.

replace

Indicates that existing information is overwritten on othe DHCP relay agent.

Default

Existing relay information is replaced.

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

lease

To specify the address lease time or the time allowed for the address to exist on the client, use the lease DHCP pool command. Use the no form of this command to reset the lease time to its default value.

lease {days [hours][minutes]| infinite}
no lease {
days [hours][minutes]| infinite}

Syntax Description

infinite

Specifies the duration of the lease is unlimited.

days

Specifies the duration of the lease in numbers of days.

hours

Specifies the number of hours in the lease if a day value is supplied.

minutes

Specifies the number of minutes in the lease if a day value is supplied.

Default

Two days

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example shows a one-day lease:

router(config-dhcp)# lease 1 days

The following example shows a one-hour lease:

router(config-dhcp)# lease 0 1 1 hour

The following example shows a one-minute lease:

router(config-dhcp)# lease 0 0 1 1 minute

The following example shows an infinite lease:

router(config-dhcp)# lease infinite

netbios-name-server

To specify the NetBIOS name servers available to the client, use the netbios-name-server DHCP pool 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
address [address2 ... address8]

Syntax Description

address

Specifies the IP address of the NetBIOS name server.

Default

None

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies the IP address of a NetBIOS name server available to the client:

router(config-dhcp)# netbios-name-server 10.12.1.90

netbios-node-type

To specify the client's NetBIOS node type, use the netbios-node-type DHCP pool command. The recommended type is h-node (Hybrid). Use the no form of this command to remove the NetBIOS node type.

netbios-node-type type
no netbios-node-type type

Syntax Description

type

Specifies the NetBIOS node type. Valid types are:

1 b-node. Broadcast

2 p-node. Peer-to-peer

4 m-node. Mixed

8 h-node. Hybrid

The recommended type is h-node.

Default

None

Command Mode

DHCP pool configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example specifies the client's netbios type as hybrid:

router(config-dhcp)# netbios node-type h-node

service dhcp

To enable DHCP services on the client when they have been disabled, use the service dhcp global configuration command. Use the no form of this command to disable DHCP services.

service dhcp
no service dhcp

Syntax Description

This command has no keywords or arguments.

Default

DHCP service are enabled.

Command Mode

Global configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

show ip dhcp binding

To display address bindings on the DHCP server, use the show ip dhcp binding EXEC command. If the address is not specified all address bindings are shown. Otherwise, only the binding for the specified client is displayed.

show ip dhcp binding [address]

Syntax Description

This command has no keywords or arguments.

Default

None

Command Mode

EXEC configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example displays the dhcp binding address parameters, including an IP address, an associated MAC address, a lease expiration date, and the type of address assignment that has occurred. Table 4 describes the fields in the example.

router> show ip dhcp binding 144.1.1.11
IP address	Hardware address				Lease expiration			Type
144.1.1.11	00a0.9802.32de					Feb 01 1998 12:00 AM			Automatic
 
router> show ip dhcp binding 144.1.3.254
IP address	Hardware address					Lease expiration			Type
144.1.2.254	02c7.f800.0422					Infinite			Manual
 

Table 4:
Field Definition
IP address The IP address of the host as recorded on the DHCP server.
Hardware address The MAC address of the host as recorded on the DHCP server.
Lease expiration The lease expiration date of the IP address of the host.
Type The manner in which the IP address was assigned to the host.
Summary of Show IP DHCP Fields

show ip dhcp conflict

To display address conflicts found when addresses are offered to the client, use the show ip dhcp conflict EXEC command. The server detects conflicts using ping. The client detects conflicts using gratuitous ARP.

show ip dhcp conflict address

Syntax Description

address

Specifies the IP address of the conflict found.

Default

None

Command Mode

EXEC configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

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 5 describes the fields in the example.

router> show ip dhcp binding conflict 10.12.1.99
IP address			Detection Method			Detection time
144.1.1.32	Ping					Feb 16 1998	12:28 PM
144.1.1.64	Gratuitous ARP					Feb 23 1998	08:12 AM	

Table 5:
Field Definition

IP Address

The IP address of the host as recorded on the DHCP server.

Detection Method

The manner in which the IP address of the hosts were found on the DHCP server. Can be a Ping or a Gratuitous ARP.

Detection Time

The time when the host was found.

Summary of Show IP DHCP Binding Conflict Fields

show ip dhcp database

To display database agent information, use the show ip dhcp database EXEC command. If a URL is not specified, all database agent records are shown. Otherwise, only information about the specified agent is displayed.

show ip dhcp database url

Syntax Description

URL

Specifies the address or name in URL form of the DHCP server that contains the database you want to display.

Default

None

Command Mode

EXEC configuration

Usage Guidelines

Address pools are stored in non-volatile RAM (NVRAM). DHCP limits the number of automatic pools as follows:

NVRAM Pools

32K 16

64K 32

128K 64

256K 128

Manual bindings are stored in NVRAM. Manual bindings are just special address pools. There is no limit on the number of manual bindings.

Automatic bindings are stored on a remote host called the database agent. The bindings are saved as text records for easy maintenance. The file format is:

IP Address Type Hardware Address Lease Expiration

Example

The following example shows values of variables in the ip dhcp database. Table 6 shows descriptions of fields in the example.

router> show ip dhcp database
URL			:	ftp://user:password@144.1.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

Table 6:
Field Definition

URL

The location of the DHCP Server that contains the database you want to read.

Read

The last time the contents of the DHCP database was read.

Written

The last time bindings were loaded into the RAM of the DHCP database were stored.

Status

Indication of whether the last read and write of host bindings were successful.

Delay

The amount of time between each write of the host bindings.

Timeout

The amount of time before the DHCP server stops attempting to load the bindings in RAM.

Failures

The number of failed attempts to load the bindings in RAM.

Successes

The number of successful attempts to load bindings in RAM.

Summary of Show IP DHCP Database Fields

show ip dhcp server statistics

To display statistics on the DHCP server, use the show ip dhcp server statistics EXEC command.

show ip dhcp server statistics

Syntax Description

This command has no arguments or keywords.

Default

None

Command Mode

EXEC configuration

Usage Guidelines

This command first appeared in Cisco IOS Release 12.0(1)T.

Example

The following example displays statistics for dhcp server variables. Table 7 shows descriptions of the fields 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
DHCPDISCOVER					200
DHCPREQUEST					178
DHCPDECLINE					0
DHCPRELEASE					0
DHCPINFORM					0
 
Message					Sent
BOOTREPLY					12
DHCPOFFER					190
DHCPACK					172
DHCPNAK					6

Table 7:
Field Definition

Memory usage

The number of kilobytes of RAM used by DHCP messages that were received in the database.

Address pools

The number of address pools that were polled for available addresses.

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.

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 IP addresses that have been assigned to hosts whose leases have expired.

Malformed messages

The number of truncated or corrupted messages that were received by the database.

Message

The DHCP message type that was received by the DHCP server.

Received

The number of DHCP messages that were received by the DHCP server.

Sent

The number of DHCP messages that were sent by the DHCP server.

Summary of Show IP DHCP Server Statistics

What to Do Next

For more information, see sections on IP Configuration in the Network Protocols Configuration Guide, Part I and Router Configuration Fundamentals Guide.


hometocprevnextglossaryfeedbacksearchhelp
Posted: Wed Jan 27 19:35:11 PST 1999
Copyright 1989-1999©Cisco Systems Inc.