Dynamic Host Configuration Protocol

DHCP is defined in RFC 1531 (the latest is RFC 2131) and provides a comprehensive method of allocating IP addresses, subnet mask, gateway address, DNS server, WINS servers, and many more parameters for IP devices.

DHCP clients send messages to the server on UDP 67, and servers send messages to the client on UDP 68. Cisco routers can also be configured for DHCP.

Example 1-3 configures a Cisco IOS router to allocate the entire range 131.108.1.0/24, with a gateway address 131.108.1.1, subnet mask 255.255.255.0, DNS servers 141.108.1.1 and 141.108.1.2, domain name cisco.com, and WINS (for Windows clients) server addresses 64.104.1.1 and 141.108.2.1. The lease should last forever, so the final command is lease infinite. You can exclude IP addresses from the pool with the following command:

ip dhcp excluded-address low-ip-address high-ip-address Example 1-3 DHCP Configuration on Cisco IOS Router

R1#show running-config | begin dhcp

ip dhcp excluded-address 131.108.1.1

!Exclude the address 131.108.1.1 to the end address 13.1.10

3.1.10

ip dhcp excluded-address 131.108.1.1 131.108.1.10

Interface Ethernet 0

ip address 131.108.1.1 255.255.255.0 !

ip dhcp pool DHCPpool

network 131.108.1.0 255.255.255.0

dns-server 141.108.1.1 141.108.1.2

domain-name cisco.com

default-router 148.16.36.6 148.16.36.3

netbios-name-server 64.104.1.1 141.108.2.1

lease infinite

To view the DHCP leases, use the Cisco IOS command show ip dhcp server. Example 1-4 displays the output taken from a router configured for DHCP (note that Cisco IOS 12.2 and higher output is shown in Example 1-4).

Example 1-4 show ip dhcp server statistics Sample Display

Router> show ip dhcp

server statistics

Memory usage

40392

Address pools

1

Database agents

1

Automatic bindings

180

Example 1-4 show ip dhcp server statistics Sample Display (Continued)

Manual bindings 1

Expired bindings 3

Malformed messages 0

Secure arp entries 1

Message

Received 12 200 178

BOOTREQUEST

DHCPDISCOVER

DHCPREQUEST

DHCPDECLINE

DHCPRELEASE

DHCPINFORM

Message

BOOTREPLY

DHCPOFFER

Sent 12

DHCPACK DHCPNAK

Example 1-4 shows that 180 devices are currently allocated IP addresses, and 178 requests were made.

0 0

Post a comment