17 Oct 2009

DHCP serving/relaying

Anatomy of getting an address from DHCP

1. Client broadcasts DHCP DISCOVER message
2. Server replies with DHCP OFFER
3. Client asks formally for the offered address with DHCP REQUEST
4. Server acknowledges with DHCP ACK
5. Client sends out a gratuitous ARP to check if the IP address is used, if not starts using it.

Setup a DHCP Server
# ip dhcp pool {pool_name}
# network { network } { mask | prefix }
# default-router { hostname | ip }
# dns-server { hostname | ip }
# domain-name { name }
# lease { days, hours... }
etc..

* Exclude addresses from pools with # ip dhcp exclude-address {low_address} {high_address}
** Addresses are always assigned on the interface that has an IP address in the same subnet as the pool.


Acting as DHCP Relay
Use following interface configuration command to forward certain broadcasts.

R1 (config-if) # ip help-address {destination server}

Troubleshooting
# sh ip dhcp binding
# clear ip dhcp binding
# sh ip dhcp pool
# sh ip dhcp server statistics


No comments:

Post a Comment