Configuring DHCP Server on Cisco Router

Posted on Monday, January 4, 2010
This article was posted in Configuration

Dynamic Host Configuration Protocol (DHCP) is a client/server protocol that automatically provides an Internet Protocol (IP) host with its IP address and other related configuration information such as the subnet mask and default gateway. DHCP allows hosts to obtain necessary TCP/IP configuration information from a DHCP server so that hosts can access network and Internet resources.

Below diagram, for which we will be going to enable the DHCP service on our Cisco router.

cisco-dhcp

The router will act as a DHCP server for the 192.168.1.0/24 network. IP Addresses already assigned to our switch (192.168.1.2) and Server (192.168.1.5) will be excluded from the DHCP pool, which will ensure that they are not given  to other hosts to cause an IP address conflict

Router#configure terminal
Router(config)#service dhcp

Now we will be creating DHCP Pool to define the IP Address & other requried parameters that will be given to the clients by the DHCP Server.

Router(config)# ip dhcp pool IP-Pool
Router(dhcp-config)#
network 192.168.1.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.1.1
Router(dhcp-config)# dns-server 202.54.56.30 4.2.2.2
Router(dhcp-config)# domain-name networkeducator.com               
Router(dhcp-config)# lease 5     
Router(dhcp-config)# exit

Now we have created Dhcp pool named “IP-Pool”.  Now router will issue the IP Addresses for the network “192.168.1.0″. The complete IP Range will be 192.168.1.1 to 192.168.1.254. configuration of Domain-name & lease period are optional.  Now we will be excluding the IP address which we want to reserve.

Router(config)# ip dhcp excluded-address 192.168.1.1 192.168.1.5
Router(config)# ip dhcp excluded-address 192.168.1.8

The above configuration was to configure Cisco Router as DHCP server in your network. We can use below command to troubleshoot.

Router# show ip dhcp binding

Bindings from all pools not associated with VRF:
IP address     Client-ID/                 Lease expiration             Type
                   Hardware address/
                   User name
192.168.1.6    0100.1e7a.c653    Jan 04 2010 02:26 PM     Automatic
192.168.1.7    0100.1e7a.c3a1    Jan 19 2010 04:00 PM    Automatic
192.168.1.9    0100.1ebe.9erc    Jan 19 2010  04:25 PM    Automatic
192.168.1.10  0100.1b53.5cbc    Jan 19 2010 08:03 PM    Automatic
192.168.1.11  0100.1e7a.261d    Jan 19 2010 08:52 PM    Automatic
Router#

 

Related Articles