DHCP Configuration Tips

25 May 2011 - Lab-Rat

On the CCIE lab, we may have to configure a DHCP server. Here’s a quick configuration, as well as a few helpful commands for doing that quickly and easily.

Sample Config

!disable address conflict logging
R702(config)#no ip dhcp conflict logging
!exclude addresses
R702(config)#ip dhcp excluded-address x.x.x.x [y.y.y.y]
!create the address pool
R702(config)#ip dhcp pool name
!subnet and mask to be assigned
R702(dhcp-config)#network x.x.x.x y.y.y.y
R702(dhcp-config)#domain-name domain
R702(dhcp-config)#dns-server x.x.x.x
R702(dhcp-config)#default-router x.x.x.x
R702(dhcp-config)#end

Debug Commands

debug ip dhcp server events - reports assignments, and other lease info.

debug dhcp detail - Lets you see the client id for manual reservations

Show Commands

show ip dhcp pool [name] - status on configured DHCP pools
Pool test1 :
Utilization mark (high/low) : 100 / 0
Subnet size (first/next) : 0 / 0
Total addresses : 1
Leased addresses : 1
Pending event : none
0 subnet is currently in the pool :
Current index IP address range Leased addresses
133.10.16.1 133.10.16.1 - 133.10.16.1 1

show ip dhcp binding [address] - view assigned IP addresses, and expiration date/time.
Bindings from all pools not associated with VRF:
IP address Client-ID/ Lease expiration Type
Hardware address/
User name
133.10.16.1 0063.6973.636f.2d30. Infinite Manual
3031.622e.3533.3362.
2e65.6132.392d.4661.
302f.312e.3136

show ip dhcp conflict [address] - shows duplicate ip addresses.

show ip dhcp database - recent DHCP activity.

show ip dhcp server statistics [interface] - Messages sent/received.
Memory usage 22927
Address pools 1
Database agents 0
Automatic bindings 0
Manual bindings 0
Expired bindings 0
Malformed messages 0
Secure arp entries 0

Message Received
BOOTREQUEST 0
DHCPDISCOVER 134
DHCPREQUEST 0
DHCPDECLINE 0
DHCPRELEASE 0
DHCPINFORM 0

Message Sent
BOOTREPLY 0
DHCPOFFER 1
DHCPACK 1
DHCPNAK 0

Client Commands

release dhcp interface - releases a dchp lease.

renew dhcp type interface - renews a dhcp lease.

Additional Reading:
Configuring the Cisco IOS DHCP Server
IP Addressing Services
DHCP Release and Renew