Cisco DHCP Configuration Commands – How to configure Dynamic Host Configuration Protocol in Cisco Router

By | April 20, 2014

What is Dynamic Host Configuration Protocol (DHCP)? How to configure DHCP on a Cisco router? DHCP lets Network Administrator to assign network parameters such as IP Address, Subnet Mask, Gateway, DNS automatically in to an end device (PC, or other device). There are many possible ways to achieve DHCP in real world, Like Windows Server, Linux Server etc. Most of the home networks acquire DHCP from the DSL modem itself or from SOHO routers. DHCP service available Cisco router, one advantage of configuring DHCP on a Cisco router is that it doesn’t need any further hardware and preserve your organization’s cost for a dedicated DHCP server.

In this Cisco DHCP configuration example we are gonna to learn the steps to be followed to configure and run DHCP in a Cisco router.


What is DHCP? And how it Works?

  • DHCP stands for Dynamic Host Configuration Protocol, as the name indicates it dynamically controls the hosts.
  • DHCP is very common in home networks and in most enterprise networks.
  • DHCP (Dynamic Host Configuration Protocol) is a networking protocol that permits network administrators centrally manage and automate the assignment of network parameters to a client device like PCs or Laptops.
  • DHCP Server holds network parameters viz. a pool (Group) of IP Address, Subnet Mask, Default Gateway address, DNS.

Operations of DHCP have 4 stages, Overall IP DHCP establishment shown in the following figure.


1. DHCPDISCOVER: Server Discovery – Broadcast

In server discovery process, when a computer or other networked device connects to a DHCP network, it starts trying to discover whether there is any DHCP server available in the network by sending broadcast to destination address. This is called DHCPDISCOVER.

All of the hosts in the network get the DHCPDISCOVER packet since it is a broadcast packet. But only the DHCP Server replies!


2. DHCPOFFER: IP Lease Offer – Unicast

After the DHCP server accepts the DHCPDISCOVER message, it replies with a DHCPOFFER message. This could be Unicast to the MAC address of the client and those packet includes an IPv4 address lease among the pool of IPs, Subnet mask, Gateway, DNS, lease duration.


3. DHCPREQUEST: IP request – Broadcast

Clients take the first offer received from DHCP server by broadcasting a DHCP Request packet called DHCPREQUEST. This message allowing the server to know that the client supposed to use the address offered by the server.


4. DHCPACK: IP lease acknowledgment – Unicast

The server directs an acknowledgment (DHCPACK) message in unicast, confirming that acceptance of the allotted IP for a specified period of time. It also used to renew the lease time.

DHCPACK Hope you got DHCP processing stages.

How to Configure and Enable DHCP in Cisco Router?

Well, let’s move on to Cisco DHCP configuration guide, configuring DHCP in Cisco router is simple task! I would explain step by step for DHCP Configuration with Cisco Packet Tracer.

Consider the following Scenario, I will implement 2 DHCP pools (smartpctricks & smartpctricks2) in the Router.


Step 1: Assigning IP Address to Ports

I will explain Cisco DHCP configuration lab in 2 simple steps.

For the above Packet Tracer Network scenario we have Router with two ports FastEthernet 0/0 and FastEthernet 0/1. Assign IP address to FastEthernet 0/0 and to FastEthernet 0/1.

Router#conf terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config)#interface fastEthernet 0/0
R1(config-if)#ip address
R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

R1(config)#interface fastEthernet 0/1
R1(config-if)#ip address
R1(config-if)#no shutdown

%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

Step 2: Cisco DHCP Pool Configuration

The syntax used for DHCP is #ip dhcp pool <pool name> . In this example I’m gonna to build two DHCP pool, One for left side network ( and other for right side network (

R1(config)#ip dhcp pool smartpctricks
default-router Default routers
dns-server Set name server
exit Exit from DHCP pool configuration mode
network Network number and mask
no Negate a command or set its defaults
option Raw DHCP options

R1(config)#ip dhcp pool smartpctricks2

Here smartpctricks & smartpctricks2 are just only a random name for the DHCP pool. There is no rules for the pool name, you may use any name as you like.

After the configuration just verify the IP address of clients. For Packet Tracer users please enable DHCP in each host.

Advanced Cisco DHCP Configurations

So we covered Cisco DHCP server configuration example, there are some other important commands which is related to Cisco DHCP configuration. Let’s discus some of those commands here.

How to Exclude Specific IPs from DHCP Pool

If you wana to exclude some IPs from the pool use the following command. Here I’m excluding the IP

R1(config)#ip dhcp excluded-address

Above command omits from the pool

How to Exclude Group of IPs from DHCP Pool

What should we do to exclude a group of IPs from the DHCP pool? Follow the configuration commands.

R1(config)#ip dhcp excluded-address

It will exclude IPs from →

Disable DHCP Server Pool

How to remove complete DHCP configurations from a Cisco router? Use the ‘no’ version of DHCP command to disable DHCP server in a Cisco router.

R1(config)#no ip dhcp pool smartpctricks

Here the pool named ‘smartpctricks’ will be removed from the router.

#show ip dhcp binding

This command shows the current bindings of addresses given to clients with their MAC address.

R1#show ip dhcp binding
IP address Client-ID/ Lease expiration Type
Hardware address 000C.85D6.41EB -- Automatic 0001.96DB.2696 -- Automatic 0001.64BA.4541 -- Automatic 00E0.8FB4.72D6 -- Automatic 0060.472A.2E71 -- Automatic 0002.1706.5E8A -- Automatic

Pass DNS Server Information in Cisco DHCP

Most of the enterprise networks running dedicated DNS Servers. DNS maps IP to a particular host name and vice versa.

Read more>> DNS Servers

How to include DNS Server IP in DHCP? Follow below steps…

R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#ip dhcp pool smartpctricks

DHCP service uses Port 67 and 68. So, if you are using a firewall, remember to open these ports.

This is all about Cisco DHCP configurations. Try to implement DHCP labs of your own and get experienced with DHCP configuration.

Definitely DHCP reduces Network Administrator’s hassles and make easy to manage the topology. Are you satisfied with my DHCP configuration on Cisco router with example? Let me know your feedback.

2 thoughts on “Cisco DHCP Configuration Commands – How to configure Dynamic Host Configuration Protocol in Cisco Router

  1. Mzii

    You example and tutorial were clear and inspiring, thank you

  2. Kola

    This is quit simpler than I thought. Thanks for the tutorial. I do have a question though. In the case where there is a server in the network and two routers, where should dhcp be configured? On the R1, the server or both R1 and R2?
    The server is directly connected to R1, R1 connects to a cluster of switches, and also connects to R2 which is also connected to a cluster of switches too.


Leave a Reply

Your email address will not be published. Required fields are marked *