If your intention is to use a Cisco Router to run DHCP then the first task is to enable the service on the router, if it hasn’t been enabled already.
Enter Global Configuration mode from Privileged Exec mode with the command configure terminal. Issue the command service dhcp. See example below:
router# configure terminal
We now need to create a pool of addresses from which IP addresses should be allocated to clients. From global configuration mode issue the command ip dhcp pool (name), where the name is chosen by you and can be alphanumerical. Follow this by indicating the network or sub network from which the addresses should be allocated with the command network 192.168.5.0 255.255.255.0. See example below:
router(config)# ip dhcp pool Glasgow
Now we have to specify what information (in addition to an ip address) will be served up to client devices. An example of the commands are given below:
router(dhcp-config)#dns-server 192.168.5.254 18.104.22.168
We have now configured the default gateway address as 192.168.5.254, the DNS Servers as 192.168.5.254 and 22.214.171.124, the domain name as buffalonet.com and the lease period as 14 days.
If there are any devices in the network that have fixed IP Addresses, including the default gateway router then we need to exclude them from the pool of addresses so as not to allocate duplicate addresses. To do this issue the following command or multiple commands, ip dhcp excluded-address 192.168.5.1 192.168.5.6. An example is show below:
router(config)#ip dhcp excluded-address 192.168.5.254
router(config)#ip dhcp excluded-address 192.168.5.1 192.168.5.6
The first example above excludes a single address and the second excludes a range of addresses.
This is the basic configuration parameters now complete, but we should really verify that the DHCP service is running and allocating addresses. To do this we can issue a command show ip dhcp binding from the privileged exec prompt. See example below:
router#show ip dhcp binding
IP address Client-ID/Hardware address/User name Lease Type Remote ID
192.168.5.7 00aa.5e34.b98c Mar 12 2013 0852 PM Automatic
192.168.5.8 00aa.5e34.b82b Mar 12 2013 0854 PM Automatic
192.168.5.9 00aa.5c9a.63e5 Mar 12 2013 0855 PM Automatic
The above output shows that 3 client devices have currently been allocated IP Addresses.
There are further verification commands that can be issued, but for the time being we will be satisfied with just the one.