3600 Cisco IOS DHCP Server

52
Cisco IOS DHCP Server 1 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 DHCP request Central site SOHO Easy IP Host B Host A Cisco IOS DHCP server 15430 WAN link

Transcript of 3600 Cisco IOS DHCP Server

Cisco IOS DHCP Server 1

Cisco IOS DHCP Server

Feature SummaryWith the introduction of Cisco IOS Easy IP Phase 2, Cisco IOS software supports Cisco IOSDynamic Host Control Protocol (DHCP) Server functionality. DHCP is a protocol that enables youto automatically assign reusable IP addresses to clients. Cisco IOS DHCP server is a full DHCPserver implementation that assigns and manages IP addresses from specified address pools withinthe 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 RFC2131. For information about DHCP options, see RFC 2132.

Also, Cisco IOS Easy IP Phase 2 supports DHCP Relay Agent functionality. A DHCP relay agent isany host that forwards DHCP packets between clients and servers with the goal of automaticallyassigning an IP address and address parameters to a client requesting an address. A DHCP relayagent enables the client and server to reside on separate subnets. If the Cisco IOS DHCP servercannot satisfy a DHCP request from its own database, it can forward the DHCP request to one ormore 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. Theclient, Host A, sends a DHCP request to the Cisco IOS DHCP server, using dhcpdiscover, which isa broadcast message requesting an IP address. Cisco IOS DHCP server then sends the request alongto a remote central DHCP server.

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

DHCP request

Central siteSOHO

Easy IP

Host B

Host A

Cisco IOSDHCP server

1543

0

WAN link

Feature Summary

2 Release 12.0(1)T

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

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

BenefitsCisco IOS DHCP server offers the following benefits:

• Reduced Internet access costs

Using automatic IP address assignment at each remote site substantially reduces Internet accesscosts. Static IP addresses are considerably more expensive to purchase than are automaticallyallocated IP addresses.

• Simplified IP address management

DHCP enables Internet service providers (ISPs) to allocate a single registered IP address to eachremote LAN. Because only a single registered IP address is required to provide global Internetaccess to all users on an entire remote LAN, customers and ISPs can use their registered IPaddresses more efficiently.

• Reduced client configuration tasks and costs

Because DHCP is easy to configure, it minimizes operational overhead and costs associated withdevice configuration tasks and eases deployment by non-technical users.

• Reduced management tasks

Hosts in remote offices can obtain dynamic IP addresses directly from the remote office routervia the Cisco IOS DHCP server, eliminating the need to configure and maintain a separate andstandalone DHCP server in the remote office.

List of Termsaddress binding—A mapping between the client’s IP and hardware (MAC) addresses. The client’sIP address may be configured by the administrator (manual address allocation) or assigned from apool by the DHCP server (automatic address allocation). The binding also contains a lease expirationdate. The default for the lease expiration date is one day.

"Your IP addressis 10.0.0.1"

Central siteSOHO

Easy IP

Host B

Host A

Cisco IOSDHCP server

1543

1

WAN link

List of Terms

Cisco IOS DHCP Server 3

address conflict—A duplication of use of the same IP address by two hosts. During addressassignment, DHCP checks for conflicts using ping and gratuitous ARP. If a conflict is detected, theaddress is removed from the pool. The address will not be assigned until the administrator resolvesthe conflict.

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

automatic address allocation—An address assignment method that assigns a permanent IP addressto 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 nodesinto addresses.

dynamic address allocation—An address assignment method where a network administratorobtains an IP address for a client for a finite period of time or until the client explicitly relinquishesthe address. Dynamic allocation is particularly useful for assigning an address to a client that will beconnected to the network only temporarily or for sharing a limited pool of IP addresses among agroup of clients that do not need permanent IP addresses. Dynamic allocation may also be a goodchoice for assigning an IP address to a new client being permanently connected to a network whereIP 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 forallocating 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 administrativelyassigned IP address to a host. Manual allocation allows DHCP to be used to eliminate the error-proneprocess of manually configuring hosts with IP addresses.

server—Any host providing configuration parameters.

Platforms

4 Release 12.0(1)T

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

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

• Cisco 7000 series

• Cisco 7200 series

• Cisco 4000 series

• Cisco 3800 series

• Cisco 3600 series

• Cisco 2500 series

• Cisco 1600 series

• Cisco 1000 series

• Cisco 700 series

• Cisco 2500 series access servers

• Cisco AS5100 access server

• Cisco AS5200 universal access server

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

• Define the DHCP database agent.

• Define an external FTP, TFTP, or RCP host storing the DHCP bindings database.

• Define and assign names to the DHCP address pool(s) from which IP addresses are allocated toclients.

• Specify DHCP options for devices where necessary, including:

— default boot image name

— default router(s)

— default DNS server(s)

— NetBIOS name server

• Specify the NetBIOS node type (b, p, m, or h)

• Decide on a DNS domain name

Understanding Message Types

Cisco IOS DHCP Server 5

Supported MIBs and RFCsThis feature supports the following RFCs:

• RFC 2131 (DHCP Basic Operation)

• RFC 2132 (Options)

• RFC 951 (Bootp)

• RFC 1542 (Bootp Interoperability)

No new MIBs are supported with this feature.

Functional DescriptionThe DHCP database is organized as a tree. The root of the tree is the address pool for the naturalnetwork. Subnet address pools comprise the middle nodes. Manual bindings represent leaves.Subnets inherit network parameters and hosts inherit subnet parameters. Try to configure commonattributes like the domain name and the DNS server at the highest (network or subnetwork) leve. Asample configuration, using Cisco IOS DHCP is shown below, configuring the domain name, asplanet.org, the DNS server as 144.1.1.2 144.1.2.2 and the netbios name server as 144.1.1.3 144.1.2.3on the network 144.1.0.0 with a subnet mask of 255.255.0.0.

router(config-dhcp)# ip dhcp database ftp://user:[email protected]/dhcp.bindings

To create a DHCP address pool, note the following sample command line:

router(config-dhcp)# ip dhcp pool 144.1.0.0/16network 144.1.0.0 255.255.0.0domain-name planet.orgdns-server 144.1.1.2.144.1.2.2netbios-name-server 144.1.1.3 144.1.2.3

Understanding Message TypesDHCP is divided up into eight message types that indicate several tasks to occur. They are describedin 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 addressparameters, typically an IP address, a MAC address, a Domain Name, and a leaseon 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 offerbecause of an address conflict.

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

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

Functional Description

6 Release 12.0(1)T

The DHCP message sequence occurs as shown in Table 2.

Table 2 DHCP Message Sequence

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

Table 3 DHCP Options

dhcprelease A message sent by the client that indicates a premature termination of the IPaddress lease.

dhcpnak A message by the Cisco IOS DHCP server indicating that the IP address usedcould not restart.

Step Task Message Issued

1 A client sends out a broadcast, requestingan address.

dhcpdiscover indicates the client needs an address.

2 The server unicasts an offer that includes anIP address, a lease date and otherparameters (for example, a domain name)to the client.

dhcpoffer offers an address to the client.

3 The client can either issue an acceptance orrejection of the address offer.

dhcprequest accepts one address offer and rejectsall others.

dhcpdecline indicates the client detected anothernode is using the offered address.

4 If the client accepts the address offer, abinding is created.

The server sends dhcpack, binding the client MACaddress with the assigned IP address and the LeaseExpiration 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 IPaddress. The DHCP messaging is completeuntil half the lease expires. At that point,the client attempts to renew the lease.

DHCP Option Name

DHCPOptionCode 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 theportion of an IP address that are being used for the subnetaddress.

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

Domain Name ServerOption

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

DHCP Message Description

Understanding Message Types

Cisco IOS DHCP Server 7

Host Name Option 12 Specifies the name of the client. The name may contain anystandard ASCII character and be up to 32 characters long. Thename may or may not be qualified with the local domain name.

Domain Name Option 15 Specifies the domain name that the client should use whenresolving hostnames via the Domain Name System.

NetBIOS over TCP/IPName Server Option

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

NetBIOS over TCP/IPNode Type Option

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

B—Broadcast node

P—Peer-to-peer node

M—Mixed node

H—Hybrid

IP Address Lease TimeOption

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 tospecify the lease time it is willing to offer.

DCHP Message TypeOption

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. Thisaddress is used in dhcpoffer and dhcprequest messages, andmay optionally be included in the dhcpack and dhcpnakmessages.

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

DHCP clients use the contents of theServer Identifier field asthe destination address for any DHCP messages unicast to theDHCP server. DHCP clients also indicate which of severallease offers are being accepted by including this option in adhcprequest message.

Renewal (T1) TimeOption

58 Specifies the time interval from address assignment until theclient transitions to the renewing state. At the time the T1 clientsends (via unicast) a dhcprequest message to the server toextends its lease.

DHCP Option Name

DHCPOptionCode Description

Configuration Tasks

8 Release 12.0(1)T

Intelligent DHCP Relay and Secondary Address PoolsWith the introduction of Cisco IOS Easy IP Phase 2, Cisco IOS software also supports intelligentDHCP Relay functionality. A DHCP relay agent is any host that forwards DHCP packets betweenclients and servers. If the DHCP relay agent sees several DHCP retransmissions, it assumes that theDHCP server is not responding because of an exhausted address pool. The intelligent DHCP Relayfeature forces the downstream DHCP server to attempt to allocate an IP address from a differentpool. This makes it possible for the client to boot with an IP address from a secondary address poolif the primary pool is depleted.

Unique Address AllocationTo prevent assigning addresses to clients that may already be in use, the Cisco IOS DHCP serverissues ICMP echo requests to pool addresses before assigning them to clients. The Cisco IOS DHCPserver pings for potential IP address conflicts. If the pings are unanswered within a configuredtimeout period, the Cisco IOS Server determines that the address is not in use. The server thenassigns the address to the requesting client. If an address conflict is detected, the Cisco IOS DHCPserver removes the offending address from the pool. The address will not be assigned until theadministrator resolves the conflict.

Configuration TasksThis section describes Cisco IOS DHCP server configuration tasks:

• Specify a DHCP Server Boot File

• Specify the Client’s Identifier

• Specify the Client’s Name

• Specify the Default Router

• Specify Domain Name IP Servers Available to the Client

• Enable DHCP Server Debugging

• Specify a Domain Name for the Client

• Specify the Client’s Hardware Address

• Specify the Client’s IP Address

• Specify the Database Agent Parameters

• Specify IP Addresses not Assigned by the DHCP Server

• Specify How Long to Wait for a Ping Reply

• Specify the Duration of a Ping Timeout

Rebinding (T2) TimeOption

59 Specifies the time interval from address assignment until theclient transitions to the rebinding state and sends (viabroadcast) a dhcprequest message any DHCP server to extendsits lease.

DHCP Option Name

DHCPOptionCode Description

Specify a DHCP Server Boot File

Cisco IOS DHCP Server 9

• Create an Address Pool Name

• Determine Whether Relay Agent Information Option is Correct

• Define the Relay Information Reforwarding Policy

• Specify the Address Lease Time

• Specify the NetBIOS Name Servers Available to the Client

• Select the Client’s NetBIOS Node Type

• Specify the DHCP Address Pool Subnet Number and Mask

• Enable DHCP Services on the DHCP Server

Specify a DHCP Server Boot FileThe boot file is used to store the boot image for the client. The boot image is generally the operatingsystem the client uses to load. To specify a bootfile for the DHCP server, use the following commandin DHCP pool configuration mode:

Specify the Client’s IdentifierThe client’s identifier is a field that identifies the client on the subnet for binding lookups. It generallyconsists of a MAC address and a media type code. To specify a client identifier string, use thefollowing command in DHCP pool configuration mode:

Specify the Client’s NameThe client can have a name that can be referenced in binding lookups instead of an IP address. Tospecify a name for the client, use the following command in DHCP pool configuration mode:

Specify the Default RouterThe default router is the router the DHCP client sends packets to once it has booted. It is the routerthat is nearest to the client on the network. To specify a default router for the client, use the followingcommand in DHCP pool configuration mode:

Command Purpose

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

Command Purpose

client-identifier unique-identifier Create a string used to identify the client during binding look-ups instead of using a MAC address.

Command Purpose

client-namename Create a string that identifies the client by name instead of IPaddress.

Command Purpose

default-router address[address2...address8]

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

Configuration Tasks

10 Release 12.0(1)T

Specify Domain Name IP Servers Available to the ClientWhen the client needs to identify a name of a DHCP server, it converts the IP address to a servername. To specify the domain name IP servers available to the client, use the following command inDHCP pool configuration mode:

Enable DHCP Server DebuggingYou can enable DHCP server debugging that allows you to view activity on the DHCP server. Theactivity can take the form of packets, which are messages the server receives; events, which aretimeouts when leases expire; and linkages, which are debugging occurrences that attributeinheritance. To enable DHCP server debugging, use the following command in EXEC mode:

Specify a Domain Name for the ClientYou can create a domain name string for the client. To create a domain name string for the client, usethe following command in DHCP pool configuration mode:

Specify the Client’s Hardware AddressYou can specify the client’s hardware address when you perform a binding lookup. The hardwareaddress is generally the MAC address, although it can be any hexadcimal string. To specify theclient’s hardware address, use the following command in DHCP pool configuration mode:

Specify the Client’s IP AddressYou 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

dns-serveraddress[address2...address8]

Specify the IP addresses of DHCP servers available to the cli-ent.

Command Purpose

debug ip dhcp server{ events | packets |linkage}

Enable debugging on the DHCP server.

Command Purpose

domain-namedomain Specify the client’s domain name.

Command Purpose

hardware-addresshardware-addresstype

Create a hardware address for the client.

Command Purpose

hostaddress[mask network-mask|prefix-length bits]

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

Specify the Database Agent Parameters

Cisco IOS DHCP Server 11

Specify the Database Agent ParametersThe 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. Youcan also set the interval between database transfers. To specify the database agent parameters, usethe following command in DHCP pool configuration mode:

Specify IP Addresses not Assigned by the DHCP ServerTo specify IP addresses not assigned by the DHCP server, use the following command in DHCP poolconfiguration mode:

Specify How Long to Wait for a Ping ReplyYou can ping a client’s address before you assign an address to another client to determine a potentialaddress conflict. To specify how many packets the DHCP server should send to the client during theping, use the following command in global configuration mode:

Specify the Duration of a Ping TimeoutYou can specify the amount of time that elapses after the DHCP server issues a ping to the clientbefore the ping stops attempting to make contact and times out. To specify the amount of time thatpasses before a ping request times out, use the following command in global configuration mode:

Create an Address Pool NameAddress pools contain available IP addresses that the DHCP server can use to assign to a clientrequesting 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 followingcommand in global configuration mode:

Command Purpose

ip dhcp databaseurl{ write-delayseconds | timeout seconds}

Set the interval between database updates and database trans-fers.

Command Purpose

ip dhcp ping packetscount Specify IP addresses to the client which have not beenassigned by the DHCP server by tracking whichaddresses do not reply to the ping.

Command Purpose

ip dhcp ping packetscount Specify how many packets the DHCP server sends to the clientwhen a ping is executed.

Command Purpose

ip dhcp ping timeout milliseconds Specify the amount of time that elapses after the DHCP serverissues a ping to the client before the server stops attempting tomake contact with the client.

Command Purpose

ip dhcp poolname Create a name for the a DHCP server address pool.

Configuration Tasks

12 Release 12.0(1)T

Determine Whether Relay Agent Information Option is CorrectYou can determine whether relay information option information is correct. To determine whetherrelay agent information option is correct, use the following command in global configuration mode:

Define the Relay Information Reforwarding PolicyIf a relay

Specify the Address Lease TimeEach address assigned by the DHCP server comes with a lease value or the amount of time for whichthe address is valid. You can define the duration of this time, using theleasecommand. To define theduration of the lease period associated with an address, use the following command in DHCP poolconfiguration mode:

Specify the NetBIOS Name Servers Available to the ClientYou can perform name resolution for NetBIOS name servers. To specify the name of the NetBIOSname servers available to the client, use the following command in DHCP pool configuration mode:

Select the Client’s NetBIOS Node TypeThe NetBIOS node type for the client can be one of four settings: broadcast, peer-to-peer, mixed, orhybrid. To specify the type of NetBIOS node you want, use the following command in DHCP poolconfiguration mode:

Command Purpose

ip dhcp relay information check Determine whether the relay agent information option is cor-rect.

Command Purpose

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

Determine the relay information reforwarding policy in a cablemodem termination system.

Command Purpose

lease{ days[hours][minutes]| infinite} Define the duration of the lease time.

Command Purpose

netbios-name-serveraddress[address2... address8]

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

Command Purpose

netbios-node-typetype Select the NetBIOS node type for the client.

Specify the DHCP Address Pool Subnet Number and Mask

Cisco IOS DHCP Server 13

Specify the DHCP Address Pool Subnet Number and MaskTo specify the DHCP address pool subnet number and mask, use the following command in DHCPpool configuration mode:

Enable DHCP Services on the DHCP ServerDHCP has a series of services associated with it. Well known services are Telnet and rlogin. Theservices are disabled by default. To enable DHCP services on the DHCP server, use the followingcommand in DHCP pool configuration mode:

Command Purpose

network [network number] [mask] Specifies the DHCP pool subnet number and mask.

Command Purpose

service dhcp Enable DHCP services on the DHCP server.

Configuration Tasks

14 Release 12.0(1)T

Monitor and Maintain the Cisco IOS DHCP ServerYou can perform the tasks in the following sections to monitor and maintain the server:

• Display Address Bindings on the DHCP Server

• Display Address Conflicts on the DHCP Server

• Display DHCP Database Information

• Display DHCP Server Statistics

• Clear Information

Display Address Bindings on the DHCP ServerThe DHCP server contains a list of all the bindings it has created for clients. To display a list of allbindings created on a specific DHCP server, use the following command in EXEC configurationmode:

Display Address Conflicts on the DHCP ServerThe DHCP server contains a list of all address conflicts that have occurred when the server has triedto assign IP addresses to clients. To display a list of all address conflicts recorded by the DHCPserver, use the following command in EXEC configuration mode:

Display DHCP Database InformationThe DHCP database contains various types of information about the activity recorded on the DHCPserver. You can display information from the server database about:

• The time of the last read of bindings

• The time of the last write of bindings

• The current delay value

• What the current timeout value

• The number of failures recorded

• The number of successes recorded

To display information from the DHCP database, use the following command in EXECconfiguration mode:

Command Purpose

show ip dhcp bindingaddress Display a list of all bindings created on a specific DHCPserver.

Command Purpose

show ip dhcp conflictaddress Display a list of all address conflicts recorded by a specificDHCP server.

Command Purpose

show ip dhcp databaseurl Display recent activity on the DHCP database.

Display DHCP Server Statistics

Cisco IOS DHCP Server 15

Display DHCP Server StatisticsThe DHCP server contains count information about certain kinds of statistics on the server. Thestatistic types are:

• Memory usage

• Number of address pools

• Number of database agents

• Number of automatic bindings

• Number of manual bindings

• Number of expired bindings

• Number of malformed messages

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

Clear InformationYou can clear several variables being set by using variousclear commands. To clear variables, usethe following commands in EXEC configuration mode:

Command Purpose

show ip dhcp server statistics Display count informaton about server statistics and messgessent and received.

Command Purpose

clear ip dhcp binding address Delete an automatic address binding from the DHCP data-base.

clear ip dhcp conflictaddress Clear an address conflict.

clear ip dhcp server statistics Reset all DHCP server counters to 0.

Configuration Examples

16 Release 12.0(1)T

Configuration ExamplesThis section provides the following Cisco IOS DHCP server examples:

• Client Bootfile Name Example

• Client MAC Address Example

• Deleting an Address Conflict from the DHCP Server Database Example

• Client MAC Address Example

• Client Name Example

• Default Router Example

• Client Domain Name Server IP Address Example

• Client Domain Name Server Name Example

• Client Hardware Address Example

• Client IP Address and Subnet Mask Example

• DHCP Database Values Example

• Ping Packet Number Example

• DHCP Server Ping Timeout Example

• Address Pool Name Example

• Address Lease Time Limit Example

• NetBIOS Name Servers Example

• Specify Address and Mask of DHCP Address Pool Example

• Client NetBIOS Node Type Example

Client Bootfile Name Example

Cisco IOS DHCP Server 17

Client Bootfile Name ExampleThe following example specifies the name of the client bootfile as routfile:

router(config-dhcp)# bootfile routfile

Client MAC Address ExampleThe following example specifies the client’s MAC address (01b7.0813.8811.66) indotted-hexadecimal notation:

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

Client Name ExampleThe following example specifies the string client1 as the name of the client:

router(config-dhcp)# client-name client1

Default Router ExampleThe 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 ExampleThe following example specifies the IP address of the Domain Name Server of the client as10.12.1.99:

router(config-dhcp)# dns-server 10.12.1.99

Client Domain Name Server Name ExampleThe following example specifies the domain name of the client as cisco.com:

router(config-dhcp)# domain-name cisco.co m

Client Hardware Address ExampleThe 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 ExampleThe following example specifies the client’s IP address as 10.12.1.99 and subnet mask as255.255.248.0:

router(config-dhcp)# host 10.12.1.99 255.255.248.0

Configuration Examples

18 Release 12.0(1)T

DHCP Database Values ExampleThe 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 ExampleThe following example specifies the number of ping attempts that are made by the DHCP server toall hosts on the network before ceasing any further ping attempts as 20 times:

router# ip dhcp ping packets 20

DHCP Server Ping Timeout ExampleThe following example specifies the number of milliseconds 800 that the DHCP server will wait fora ping reply before considering the ping a failure:

router# ip dhcp ping timeout 800

Address Pool Name ExampleThe following example specifies the string used for the address pool created as pool1:

router# ip dhcp pool pool1

Address Lease Time Limit ExampleThe 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 ExampleThe following example specifies the IP address of a NetBIOS name server available to the client as10.12.1.90:

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

Specify Address and Mask of DHCP Address Pool Example

Cisco IOS DHCP Server 19

Specify Address and Mask of DHCP Address Pool ExampleThe following example specifies the IP address and mask of a DHCP address pool. The address isspecified as 144.1.0.0 and the mask is specified as 255.255.0.0:

router(config-dhcp)# network 144.1.0.0 255.255.0.0

Client NetBIOS Node Type ExampleThe 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 ExamplesThis section provides the following monitoring and maintaining Cisco IOS DHCP server examples:

• DHCP Binding Address Parameters Example

• DHCP Conflicts Example

• Database Agent Information Example

• DHCP Server Statistics Example

• Deleting Client Address Binding Example

• Deleting an Address Conflict from the DHCP Server Database Example

DHCP Binding Address Parameters ExampleThe 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.11IP addressHardware address Lease expiration Type144.1.1.1100a0.9802.32de Feb 01 1998 12:00 AM Automatic

router> show ip dhcp binding 144.1.3.254IP addressHardware address Lease expiration Type144.1.2.25402c7.f800.0422 Infinite Manual

DHCP Conflicts ExampleThe following example displays the detection method, for example, ping or gratuitous ARP, andDetection Time (Feb 16 1998 for 144.1.1.32) for all IP addresses the DHCP server has offered thathave conflicts with other devices:

router> show ip dhcp binding conflict 10.12.1.99IP address Detection Method Detection time144.1.1.32Ping Feb 16 199812:28 PM144.1.1.64Gratuitous ARP Feb 23 199808:12 AM

Configuration Examples

20 Release 12.0(1)T

Database Agent Information ExampleThe following example shows values of variables in the dhcp database:

router> show ip dhcp databaseURL : ftp://user:[email protected]/router-dhcpRead : Dec 01 1997 12:01 AMWritten : NeverStatus : Last read succeeded. Bindings have been loaded in RAM.Delay : 300 secondsTimeout : 300 secondsFailures : 0Successes : 1

DHCP Server Statistics ExampleThe following example shows values of DHCP server statistics.

router# show ip dhcp server statisticsMemory usage 40392Address pools 3Database agents 1Automatic bindings 190Manual bindings 1Expired bindings 3Malformed messages 0

Message ReceivedBOOTREQUEST 12DHCPDISCOVER 200DHCPREQUEST 178DHCPDECLINE 0DHCPRELEASE 0DHCPINFORM 0

Message SentBOOTREPLY 12DHCPOFFER 190DHCPACK 172DHCPNAK 6

Deleting Client Address Binding ExampleThe 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 ExampleThe following example shows an address conflict being deleted from the DHCP server database:

router> clear ip dhcp conflict 10.12.1.99

Deleting an Address Conflict from the DHCP Server Database Example

Cisco IOS DHCP Server 21

Command ReferenceThis section documents the following new or modified commands. All other commands used withthis feature are documented in the Cisco IOS Release 12.0 command references.

• bootfile

• clear ip dhcp binding

• clear ip dhcp conflict

• clear ip dhcp server statistics

• client-identifier

• client-name

• debug ip dhcp server

• domain-name

• dns-server

• domain-name

• hardware-address

• host

• ip dhcp database

• 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

• service dhcp

• show ip dhcp binding

• show ip dhcp conflict

• show ip dhcp database

• show ip dhcp server statistics

Command Reference

22 Release 12.0(1)T

bootfileTo specify the name of the default boot imageon the server, use thebootfile DHCP pool command.Use theno form of this command to delete the boot image name.

bootfile filenameno bootfilefilename

Syntax Description

DefaultThe default filename is 12.0(1)T

Command ModeDHCP pool configuration

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

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

router(config-dhcp)# bootfile routfile

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

clear ip dhcp binding

Cisco IOS DHCP Server 23

clear ip dhcp bindingTo delete an automatic address binding from the DHCP database, use theclear ip dhcp bindingEXEC command. Typically, the address denotes the client’s IP address. If the * character is used asthe address parameter, DHCP clears all automatic bindings.

clear ip dhcp binding address

Syntax Description

Command ModePrivileged EXEC

Usage GuidelinesThe client’s IP address may be configured by the administrator (manual address allocation) orassigned from a pool by the DHCP server (automatic address allocation). The binding also containsa lease expiration date. The default for the lease expiration date is one day.

ExampleThe following example shows the address binding with an IP address of 10.12.1.99 being deletedfrom a client:

router# clear ip dhcp binding 10.12.1.99

Related Commandsshow ip dhcp bindingip dhcp poollease

address The address of the binding you want to clear.

Command Reference

24 Release 12.0(1)T

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

clear ip dhcp conflictaddress

Syntax Description

Command ModePrivileged EXEC

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

ExampleThe following example shows an address conflict of 10.12.1.99 being deleted from the DHCP serverdatabase:

router# clear ip dhcp conflict 10.12.1.99

Related Commandsshow ip dhcp conflict

address The address of the host that contains the conflicting address you wantto clear.

clear ip dhcp server statistics

Cisco IOS DHCP Server 25

clear ip dhcp server statisticsTo reset all DHCP counters, use theclear ip dhcp server statisticsEXEC command. The commandshow ip dhcp server statistics displays DHCP counters.

clear ip dhcp server statistics

Syntax DescriptionThis command has no arguments or keywords.

DefaultAll counters are cumulative. In other words, they increment from the value recorded in the mostrecent session initiated by theshow ip dhcp server statistics command. The counters will beinitialized, or set to zero, with this command.

Command ModePrivileged EXEC

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

Related Commandsshow ip dhcp server statistics

Command Reference

26 Release 12.0(1)T

client-identifierTo specify the client’s MAC address or unique identifier (in dotted-hexadecimal notation), use theclient-identifier DHCP pool command. It is valid for host pools only. Use theno form of thiscommand to delete the client identifier.

client-identifier unique-identifierno client-identifier unique-identifier

Syntax Description

DefaultNone

Command ModeDHCP pool configuration

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

Note that Microsoft clients require client identifiers instead of hardware addresses. The clientidentifier is formed by concatenating the media type and the MAC address. For example, theMicrosoft client identifier of the client’s Ethernet address of b708.1388.f166 is 01b7.0813.88f1.66where 01 represents Microsoft’s code for the Ethernet media type. For a list media type codes, seeyour manufacturer’s documentation.

ExampleThe 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

Related Commandsnetwork

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

client-name

Cisco IOS DHCP Server 27

client-nameTo specify the client’s name, use theclient-nameDHCP pool command. The client name should notinclude the domain name. Use theno form of this command to remove the client name.

client-namenameno client-namename

Syntax Description

DefaultNone

Command ModeDHCP pool configuration

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

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

router(config-dhcp)# client-name client1

name Specifies the client’s name, using any standard ASCII character. Thestring can be up to 32 characters long. The client name should notinclude the domain name. For example, the namemars should not bespecified asmars.planet.org.

Command Reference

28 Release 12.0(1)T

debug ip dhcp serverTo enable DHCP server debugging, use thedebug ip dhcp server EXEC command.

debug ip dhcp server{ events | packets | linkage}no debug ip dhcp server{ events | packets | linkage}

Syntax Description

DefaultDisabled by default.

Command ModePrivileged EXEC

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

Related Commandsclear ip dhcp server statisticsshow ip dhcp server statistics

events Reports server events, like address assignments and database updates.

packets Decodes DHCP receptions and transmissions.

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

default-router

Cisco IOS DHCP Server 29

default-routerTo specify the default router list for the client, use thedefault-router DHCP pool command. Youcan specify up to seven routers in the list. Routers are listed in order of preference (address1 is themost preferred router, address2 is the next most preferred router, and so on.) Use theno form of thiscommand to remove the default router list. The IP address should be on the same subnet as the clientsubnet.

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

Syntax Description

DefaultThe default router has no default address.

Command ModeDHCP pool configuration

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

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

router(config-dhcp)# default-router 10.12.1.99

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.

Command Reference

30 Release 12.0(1)T

dns-serverTo specify the domain name IP servers available to the client, use thedns-server DHCP poolcommand. Servers are listed in order of preference (address1 is the most preferred router, address2is the next most preferred router, and so on.) Use theno form of this command to remove the DNSserver list.

dns-serveraddress[address2... address8]no dns-serveraddress[address2... address8]

Syntax Description

DefaultNone

Command ModeDHCP pool configuration

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

ExampleThe following example specifies 10.12.1.99 as the IP address of the Domain Name Server of theclient:

router(config-dhcp)# dns-server 10.12.1.99

Related Commandsdomain-namenetwork

address Specifies the IP address of a domain name server. One IP address isrequired, although you can specify up to eight addresses in onecommand line.

domain-name

Cisco IOS DHCP Server 31

domain-nameTo specify the client’s domain name or name of a network node, use thedomain-nameDHCP poolcommand. Use theno form of this command to remove the domain name.

domain-namedomainno domain-namedomain

Syntax Description

DefaultNone

Command ModeDHCP pool configuration

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

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

router(config-dhcp)# domain-name cisco.co m

Related Commandsdns-servernetwork

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

Command Reference

32 Release 12.0(1)T

hardware-addressTo specify the client’s hardware address, use thehardware-address DHCP pool command. It isvalid for host pools only. Use theno form of this command to remove the hardware address.

hardware-addresshardware-address typeno hardware-addresshardware-address type

Syntax Description

DefaultEthernet is the default type if none is specified.

Command ModeDHCP pool configuration

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

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

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

• hardware-address • Specifies the IP address of the client’s hardware platform.

• type Indicates the protocol of the hardware platform. Strings and values areacceptable. 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.

host

Cisco IOS DHCP Server 33

hostTo specify the client’s IP address and network mask, use thehostDHCP pool command. If the maskand prefix length are unspecified, DHCP examines its address pools. If no mask is found in the pooldatabase, the class A, B, or C natural mask is used. This command is valid for host pools only. Usetheno form of this command to remove the client’s IP address.

hostaddress network-mask| prefix-length bitsno hostaddress network-mask| prefix-length bits

Syntax Description

DefaultNone

Command ModeDHCP pool configuration

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

ExampleThe following example specifies 10.12.1.99 as the client’s IP address and 255.255.248.0 as thesubnet mask:

router(config-dhcp)# host 10.12.1.99 255.255.248.0

address Specifies the IP address of the client.

network-mask (Optional) Specifies the network mask of the client.

bits (Optional) Specifies the number of bits that comprise the addressprefix.

Command Reference

34 Release 12.0(1)T

ip dhcp databaseTo specify database agent parameters, use theip dhcp databaseglobal configuration command. Theadministrator may configure multiple database agents. The URL is an FTP, TFTP, or RCP uniformresource locator. Use theno form of this command to remove the database agent.

ip dhcp databaseurl{ write-delay seconds | timeout seconds}no ip dhcp databaseurl { write-delay seconds | timeout seconds}

Syntax Description

This command has no arguments or keywords.

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

Command ModeGlobal configuration

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

ExampleThe following example specifies the DHCP database update delay value and the DHCP databasetransfer 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

Related Commandsip dhcp ping packetsip dhcp ping timeoutip dhcp pool

url The name or the web address of the DHCP server.

write-delay Specifies how soon DHCP sends database updates. By default, DHCPwaits 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 thatexceed the timeout period are aborted. By default, DHCP waits 300seconds before aborting a database transfer. Infinity is defined as zeroseconds.

ip dhcp ping packets

Cisco IOS DHCP Server 35

ip dhcp ping packetsTo specify the number of packets to send to a pool address as part of a ping operation, use theipdhcp ping packets global configuration command. The DHCP server pings a pool address beforeassigning it to a client. If the ping is unanswered, DHCP assumes (with a high probability) that theaddress is not in use. The server then assigns the address to the requesting client. Use theno form ofthis command to prevent the server from pinging pool addresses.

ip dhcp ping packetscountno ip dhcp ping packetscount

Syntax Description

DefaultTwo transmissions

Command ModeGlobal configuration

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

ExampleThe following example specifies 20 ping attempts by the DHCP server before ceasing any furtherping attempts:

router# ip dhcp ping packets 20

Related Commandsip dhcp databaseip dhcp ping timeoutip dhcp pool

count Indicates how many pings are sent before giving up. The default valueis two transmissions.

Command Reference

36 Release 12.0(1)T

ip dhcp ping timeoutTo specify how long the DHCP server has to wait for a ping reply from an address pool, use theipdhcp ping timeout global configuration command. This command specifies how long to wait for aping reply in milliseconds. Use theno form of this command to restore the default number ofmilliseconds (500) of the timeout.

ip dhcp ping timeout millisecondsno ip dhcp ping timeoutmilliseconds

Syntax Description

DefaultThe default timeout is 500 milliseconds.

Command ModeGlobal configuration

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

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

router# ip dhcp ping timeout 800

Related Commandsip dhcp databaseip dhcp ping packetsip dhcp pool

milliseconds The amount of time in milliseconds it takes for a ping reply to stopattempting to reach a pool address for client assignment. Themaximum timeout is 10000 milliseconds (10 seconds). The defaulttimeout is 500 milliseconds.

ip dhcp pool

Cisco IOS DHCP Server 37

ip dhcp poolTo create an address pool from which thedhcp ping packets command can ping a pool addressbefore assigning it to a client, use theip dhcp pool global configuration command. Duringexecution, 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 subnetnumber and default router list. Use theno form of this command to remove the address pool.

ip dhcp poolnameno ip dhcp poolname

Syntax Description

DefaultNone

Command ModeGlobal configuration

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

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

router(config-dhcp)# ip dhcp pool pool1

Related Commandsdns-serverdomain-nameip dhcp databaseip dhcp ping packetsip dhcp ping timeoutnetwork

name Can either be a symbolic string (such as “engineering”) or an integer(such as 0).

Command Reference

38 Release 12.0(1)T

ip dhcp relay information checkTo specify whether the relay agent information option is validated inbootreply messages, use theip dhcp relay information check global configuration command. This command is used by cablemodem termination systems. By default, DHCP checks relay information. Invalid messages aredropped. Use theno form of this command to disable an information check.

ip dhcp relay information checkno ip dhcp relay information check

Syntax DescriptionThis command has no arguments or keywords.

DefaultDHCP checks relay information. Invalid messages are dropped.

Command ModeGlobal configuration

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

Related Commandsip dhcp relay information optionip dhcp relay information policy

ip dhcp relay information option

Cisco IOS DHCP Server 39

ip dhcp relay information optionTo specify whether the relay agent information option is added to forwardedbootrequestmessages,use theip dhcp relay information option global configuration command. This command is used bycable modem termination systems. By default, DHCP does not insert relay information. Use thenoform of this command to disable inserting relay information to forwardedbootrequest messages.

ip dhcp relay information optionno ip dhcp relay information option

Syntax DescriptionThis command has no arguments or keywords.

DefaultDHCP does not insert relay information.

Command ModeGlobal configuration

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

Related Commandsip dhcp relay information checkip dhcp relay information policy

Command Reference

40 Release 12.0(1)T

ip dhcp relay information policyTo define the relay information reforwarding policy, use theip dhcp rellay information policyglobal 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 addressparameter, DHCP clears all automatic bindings. Use theno form of this command to restore thedefault relay information policy.

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

Syntax Description

DefaultExisting relay information is replaced.

Command ModeGlobal configuration

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

Related Commandsip dhcp relay information checkip dhcp relay information option

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

keep Indicates that existing information is left unchanged on the DHCPrelay agent.

replace Indicates that existing information is overwritten on othe DHCP relayagent.

lease

Cisco IOS DHCP Server 41

leaseTo specify the address lease time or the time allowed for the address to exist on the client, use thelease DHCP pool command. Use theno form of this command to reset the lease time to its defaultvalue.

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

Syntax Description

DefaultTwo days

Command ModeDHCP pool configuration

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

ExampleThe 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

Related Commandsip dhcp databaseip dhcp pool

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.

Command Reference

42 Release 12.0(1)T

netbios-name-serverTo specify the NetBIOS name servers available to the client, use thenetbios-name-server DHCPpool command. Use theno form of this command to remove the NetBIOS name server list.

netbios-name-serveraddress[address2... address8]no netbios-name-serveraddress[address2... address8]

Syntax Description

DefaultNone

Command ModeDHCP pool configuration

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

ExampleThe 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

Related Commandsdns-name serverdns-serverdomain-namenetbios-node-typenetwork

address Specifies the IP address of the NetBIOS name server.

netbios-node-type

Cisco IOS DHCP Server 43

netbios-node-typeTo specify the client’s NetBIOS node type, use thenetbios-node-type DHCP pool command. Therecommended type is h-node (Hybrid). Use theno form of this command to remove the NetBIOSnode type.

netbios-node-typetypeno netbios-node-typetype

Syntax Description

DefaultNone

Command ModeDHCP pool configuration

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

ExampleThe following example specifies the client’s netbios type as hybrid:

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

Related Commandsnetbios-name-server

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.

Command Reference

44 Release 12.0(1)T

networkTo set and clear a DHCP address pool’s subnet number and mask, use the DHCP poolnetworkcommand.

network <network number> [mask]no network

Syntax Description

DefaultNone

Command ModeDHCP pool configuration

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

Examplerouter(config-dhcp)# ip dhcp pool 144.1.0.0/16network 144.1.0.0 255.255.0.0domain-name planet.orgdns-server 144.1.1.2.144.1.2.2netbios-name-server 144.1.1.3 144.1.2.3

Related Commandsdns-serverdomain-nameip dhcp poolnetbios-name server

network number The IP address of the DHCP address pool.

mask The bit combination that renders which portion of the address of theDHCP address pool refers to the network or subnet and which partrefers to the host.

service dhcp

Cisco IOS DHCP Server 45

service dhcpTo enable DHCP services on the client when they have been disabled, use theservice dhcp globalconfiguration command. Use theno form of this command to disable DHCP services.

service dhcpno service dhcp

Syntax DescriptionThis command has no keywords or arguments.

DefaultDHCP service are enabled.

Command ModeGlobal configuration

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

Command Reference

46 Release 12.0(1)T

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

show ip dhcp binding[address]

Syntax DescriptionThis command has no keywords or arguments.

DefaultNone

Command ModeEXEC configuration

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

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

router> show ip dhcp binding 144.1.1.11IP addressHardware address Lease expiration Type144.1.1.1100a0.9802.32de Feb 01 1998 12:00 AM Automatic

router> show ip dhcp binding 144.1.3.254IP addressHardware address Lease expiration Type144.1.2.25402c7.f800.0422 Infinite Manual

Summary of Show IP DHCP Fields

Related Commandsclear ip dhcp bindinglease

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

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.

show ip dhcp conflict

Cisco IOS DHCP Server 47

show ip dhcp conflictTo display address conflicts found when addresses are offered to the client, use theshow ip dhcpconflict EXEC command. The server detects conflicts using ping. The client detects conflicts usinggratuitous ARP.

show ip dhcp conflictaddress

Syntax Description

DefaultNone

Command ModeEXEC configuration

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

ExampleThe following example displays the Detection Method and Detection Time for all IP addresses theDHCP server has offered that have conflicts with other devices. Table 5 describes the fields in theexample.

router> show ip dhcp binding conflict 10.12.1.99IP address Detection Method Detection time144.1.1.32Ping Feb 16 199812:28 PM144.1.1.64Gratuitous ARP Feb 23 199808:12 AM

Summary of Show IP DHCP Binding Conflict Fields

Related Commandsclear ip dhcp conflictip dhcp ping packetsip dhcp ping timeout

address Specifies the IP address of the conflict found.

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 foundon the DHCP server. Can be a Ping or a Gratuitous ARP.

Detection Time The time when the host was found.

Command Reference

48 Release 12.0(1)T

show ip dhcp databaseTo display database agent information, use theshow ip dhcp databaseEXEC command. If a URLis not specified, all database agent records are shown. Otherwise, only information about thespecified agent is displayed.

show ip dhcp databaseurl

Syntax Description

DefaultNone

Command ModeEXEC configuration

Usage GuidelinesAddress pools are stored in non-volatile RAM (NVRAM). DHCP limits the number of automaticpools 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 nolimit on the number of manual bindings.

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

IP Address Type Hardware Address Lease Expiration

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

show ip dhcp database

Cisco IOS DHCP Server 49

ExampleThe following example shows values of variables in the ip dhcp database. Table 6 shows descriptionsof fields in the example.

router> show ip dhcp databaseURL : ftp://user:[email protected]/router-dhcpRead : Dec 01 1997 12:01 AMWritten : NeverStatus : Last read succeeded. Bindings have been loaded in RAM.Delay : 300 secondsTimeout : 300 secondsFailures : 0Successes : 1

Summary of Show IP DHCP Database Fields

Related Commandsip dhcp database

Field Definition

URL The location of the DHCP Server that contains the databaseyou 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 theDHCP database were stored.

Status Indication of whether the last read and write of host bindingswere successful.

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

Timeout The amount of time before the DHCP server stops attemptingto 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.

Command Reference

50 Release 12.0(1)T

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

show ip dhcp server statistics

Syntax DescriptionThis command has no arguments or keywords.

DefaultNone

Command ModeEXEC configuration

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

ExampleThe following example displays statistics for dhcp server variables. Table 7 shows descriptions ofthe fields in the example.

router> show ip dhcp server statisticsMemory usage 40392Address pools 3Database agents 1Automatic bindings 190Manual bindings 1Expired bindings 3Malformed messages 0

Message ReceivedBOOTREQUEST 12DHCPDISCOVER 200DHCPREQUEST 178DHCPDECLINE 0DHCPRELEASE 0DHCPINFORM 0

Message SentBOOTREPLY 12DHCPOFFER 190DHCPACK 172DHCPNAK 6

show ip dhcp server statistics

Cisco IOS DHCP Server 51

Summary of Show IP DHCP Server Statistics

Related Commandsclear ip dhcp server statistics

Field Definition

Memory usage The number of kilobytes of RAM used by DHCP messagesthat were received in the database.

Address pools The number of address pools that were polled for availableaddresses.

Database agents The number of database agents configured in the DHCPdatabase.

Automatic bindings The number of IP addresses that have been automaticallymapped to the MAC addresses of hosts that are found in theDHCP database.

Manual bindings The number of IP addresses that have been manually mappedto the MAC addresses of hosts that are found in the DHCPdatabase.

Expired bindings The number of IP addresses that have been assigned to hostswhose leases have expired.

Malformed messages The number of truncated or corrupted messages that werereceived by the database.

Message The DHCP message type that was received by the DHCPserver.

Received The number of DHCP messages that were received by theDHCP server.

Sent The number of DHCP messages that were sent by the DHCPserver.

What to Do Next

52 Release 12.0(1)T

What to Do NextFor more information, see sections on IP Configuration in theNetwork Protocols ConfigurationGuide, Part I andRouter Configuration Fundamentals Guide.