DHCP is a successor to BOOT/P protocol. DHCP allows us to dynamically assign IP addresses, subnet mask,default gateway to hosts on a network. In other words, DHCP allows us to IP configure the client computers on a network dynamically at boot time.
DHCP configuration commands
ip dhcp pool <poolname>
Configures a DHCP address pool on a Cisco IOS DHCP Server and enters DHCP pool configuration mode
network 192.168.2.0 255.255.255.0
Provides the IP address range for allocation to the dhcp client computers.
Assigns the domain name for the dhcp client. The domain name is used as a suffix for any domain requests sent out.
Specifies the IP address of a DNS server. One IP address is required, although you can specify up to eight addresses in one command line
Specifies the IP address of a router. One IP address is required, although you can specify up to eight addresses in one command line.
To configure the duration of the lease for an IP address that is assigned from a Cisco IOS DHCP Server to a DHCP client, use the lease DHCP pool configuration command. To restore the default value, use the no form of this command. The default lease period is 1 day.
clear ip dhcp conflict * - Clears all ip address conflicts.
clear ip dhcp server statistics - DHCP server counters will be initialized, or set to zero, with the clear ip dhcp server statistics command.
clear ip dhcp binding * - Clears all automatic bindings.
clear ip dhcp binding a.b.c.d - Deletes the specified address binding from DHCP server database
Configure Cisco router as DHCP Client:
This is done using a single command,
Router(config-if)#ip address dhcp
Un-Configure Cisco IOS router as DHCP client:
Router(config-if)#no ip address dhcp
Note the distinction between dhcp server and dhcp client. A router may be configured in both ways. When configured as dhcp server, it provides dhcp information to the dhcp clients on the network, whereas, if configured as dhcp client, it takes dhcp information from other dhcp server on the network.