How To Configure DHCP On a Cisco Router

Having understood DHCP and DHCP operation, we are now in a comfortable position to configure the DHCP service on a Cisco router and enable it to hand out the network parameters to its local devices.

In fact this is how your home Internet modem/router operates. Your PC obtains a private IP address via DHCP from a pool of IP addresses configured on the router. The modem/router is assigned with a public IP address by the Internet Service Provider (ISP) to connect to the Internet. As you connect more PCs or Android phones to Internet, internally each gets its own private IP address from the router (DHCP server) and by the mechanism of NAT (Network Address Translation) their IP addresses are mapped to a single public IP address.

I’ve created a simple topology in GNS3 consisting of one router and three PCs. The objective is to configure DHCP in the router so that all PCs get their IP address and other network parameters from the router.

Network Topology_DHCP

First step is to enable dhcp service in the router. Although it’s enabled by default, running the command doesn’t hurt.

R2# conf t
R2(config)#service dhcp

Next step is to create an IP address pool from which the server can pick and send IP addresses to the clients. Note that “IP-POOL” is the name of the DHCP pool we are creating.

R2(config)#ip dhcp pool IP-POOL

This tells the router to issue IP addresses for the network, which translates to the range –

Now we’ll configure the network parameters that will be given to each client. This includes default gateway, dns servers, domain name, lease period in days.


R2(dhcp-config)#lease ?
  <0-365>   Days
  infinite  Infinite lease

R2(dhcp-config)#lease 5

The last step is to exclude IP addresses from the pool that should not be given to the clients. These addresses are usually the IP addresses of servers such as FTP, HTTP, DNS, etc. Drop back to ‘global configuration mode‘ and enter the following:

R2(config)#ip dhcp excluded-address
R2(config)#ip dhcp excluded-address

This excludes IP addresses – & As you can see, there’s an option to exclude a range of IP addresses or a specific address.

That’s all there to it to get the DHCP service up and running on the Cisco router. Now let’s tell the PCs to get the IP address from the DHCP sever. The PCs are VPCS nodes that come with GNS3.


As you can see VPCS does a nice job of displaying the DORA messages as the DHCP conversation happens between the server and the client. Note that the DHCP gives out the IP addresses starting from since we have excluded the first five IP addresses

The show ip dhcp binding command shows all the DHCP bindings and their status, useful to ensure that the configuration is right and for troubleshooting.

R2#sh ip dhcp binding
Bindings from all pools not associated with VRF:
IP address      Client-ID/              Lease expiration        Type       State      Interface
                Hardware address/
                User name     0100.5079.6668.00       Jan 30 2016 03:42 PM    Automatic  Active     FastEthernet0/0     0100.5079.6668.01       Jan 30 2016 03:44 PM    Automatic  Active     FastEthernet0/0     0100.5079.6668.02       Jan 30 2016 03:45 PM    Automatic  Active     FastEthernet0/0

About Deepak Devanand

Seeker of knowledge
This entry was posted in DHCP and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s