The Dynamic Host Configuration Protocol (DHCP) is considered to be an evolution of the Bootstrap Protocol (BootP).
DHCP is literally build upon BootP, and BootP remains an internal part of DHCP. Both protocols have been created to provide IP addresses to clients when needed.
The difference between them is that while BootP provides an IP address to a client according to the client’s hardware address on the BootP server table, DHCP by default provides an IP address automatically to the client from a pool of IP addresses.
Besides an IP address, the DHCP server can provide the client a lot of information, such as DNS server IP address, Default gateway IP address, Domain name and much more.
A Cisco IOS device can be configured to act as:
- a DHCP server – by providing IP addresses when requested to do so
- a DHCP client – when it requests an IP address
- a DHCP relay agent – when it captures IP requests from clients, adds extra information to the request for user identification purposes, and forwards the request to the DHCP server
Cisco IOS devices can be configured to act as all of the above and even in combinations of two or three of roles. In this article I will investigate the operation of Cisco routers under all of the above roles.
Cisco IOS Router Acting as a DHCP Server
Let’s start by investigating the process of IP address assignment when a DHCP client requests an IP address from a DHCP server. The messages exchanged between client and server can be seen in the diagram below:

The above diagram presents the DHCP message sequence. Here’s how it all goes down:
- The client sends a DHCP Discover message to locate a DHCP server – this is a broadcast message
- The DHCP server responds with a DHCP Offer unicast message – this message includes the IP address offered to the client, default gateway address and lease time for the IP address offered; it may also include DNS servers, TFTP server, and other information
- The client responds with a DHCP Request message which is a formal request for the IP address offered by the server – this is again a broadcast message
- Finally the server responds with a DHCP Ack unicast message confirming that the IP address has been leased to the client
Below is a list of the most important commands to enable a Cisco router to emulate a DHCP server:

Now let’s use the above commands in a real scenario. A Cisco router is configured to provide DHCP functionality as follows:
- Router(config)# ip dhcp excluded-address 172.16.1.1 172.16.1.3
- Router(config)# ip dhcp pool DATA
- Router(config-dhcp)#network 172.16.1.0 255.255.255.0
- Router(config-dhcp)#dns-server 172.16.1.1 172.16.1.21
- Router(config-dhcp)#default-router 172.16.1.1
- Router(config-dhcp)#lease 7
Based on the above configuration let’s see the messages exchanged as captured from Ethereal application. A screen shot of the messages can be seen below:

Details on the DHCP Offer message sent by the Cisco router can be seen below. Make a note of the client’s offered IP address (172.16.1.5), option 3 – default router’s address, option 51- IP address lease time, option 6 – IP addresses of DNS servers.

Cisco IOS Router Acting as a DHCP Client
A Cisco router can be configured to act as DHCP client and obtain dynamically an interface address by using the command ip address dhcp in interface configuration mode. Issuing this command causes the router to transmit DHCP Discover messages on the specific interface.
Cisco IOS Router Acting as a DHCP Relay Agent
By default routers do not forward broadcasts. In internetworks, most of the times, a DHCP server is located on a different network than the majority of its clients.
For DHCP messages to be able to reach the server, configuration of IP helper addresses is required. IP helper address [DHCP server IP address] interface command instructs a router to intercept DHCP broadcast messages and forward them as unicasts to the DHCP server hence providing “relay” functionality.
DHCP relay agents provide extra security to the network by hiding the server’s IP address from the clients. The client knows only the IP address of the relay agent.
The image below shows a common scenario where IP helper address is required.

The next image shows an IP DHCP Offer message as received on the client.
Note the IP address of the relay agent specified in the message. The client with the help of IP helper address on the relay agent is able to receive its IP address and all other information options provided.

Telecom companies use the services provided by DHCP relay agents extensively. Specifically the ip dhcp relay information option global configuration command which enables the DHCP relay agent to include information about itself to the DHCP requests sent from clients to DHCP server.
This is very useful for telecom operators when ATM routed bridge encapsulation (RBE) is used so that ATM interface and PVC over which the DHCP request came in is transmitted to the server from the relay agent. This information can be used to authenticate the client and help the DHCP server to apply the appropriate policy decisions.
The image below shows schematically the DHCP relay information option concept.

Summary
- DHCP functionality can be reliably configured on Cisco IOS devices. Cisco devices can be configured to act as DHCP servers, DHCP clients, or DHCP relay agents or even a combination of these.
- DHCP options like DNS servers, Domain name, lease time, etc. can be configured on Cisco devices.
- IP helper address activates the DHCP relay agent functionality on Cisco devices.
- DHCP relay agent options can be activated on Cisco devices so that supplementary services such as RBE functionality could be effective.
Prepare for Your Next Exam with Cisco Training by TrainSignal

TrainSignal’s Cisco Certification Training will help you master all the critical Cisco Networking Skills to prepare you for your next Cisco Exam! Learn more…







its great this information is very very useful.
hi chris,
The DHCP topic which u have described is quite GOOD .
very clear and smothly explained..
OK, I configured my new cisco1801 to act as a DHCP server.
And it works .. (of course).
But … one question though …
My config is as below:
…
!
! exclude the IP-address
!
ip dhcp excluded-address 10.10.0.65
!
ip dhcp pool laptop_pool
import all
network 10.10.0.64 255.255.255.248
default-router 10.10.0.65
dns-server 10.10.0.65
domain-name myown.net
lease 0 2
!
…
The server starts giving away IP-addresses from 10.10.0.66 until 10.10.0.70.
I connected a device (an WiFi access point) to the interface Fa3 (layer2 int Fa3 with layer3 on interface VLAN3) of the c1801 and indeed I see a binding, no problem with that!
The problem is that every hour I do see the following in the logging (DHCP server event debugging enabled):
Jan 21 10:23:10: DHCPD: Sending notification of ASSIGNMENT:
Jan 21 10:23:10: DHCPD: address 10.10.0.66 mask 255.255.255.248
Jan 21 10:23:10: DHCPD: htype 1 chaddr 0012.1770.5574
Jan 21 10:23:10: DHCPD: lease time remaining (secs) = 7200
…
Jan 21 11:23:11: DHCPD: Sending notification of ASSIGNMENT:
Jan 21 11:23:11: DHCPD: address 10.10.0.66 mask 255.255.255.248
Jan 21 11:23:11: DHCPD: htype 1 chaddr 0012.1770.5574
Jan 21 11:23:11: DHCPD: lease time remaining (secs) = 7200
…
Jan 21 12:23:12: DHCPD: Sending notification of ASSIGNMENT:
Jan 21 12:23:12: DHCPD: address 10.10.0.66 mask 255.255.255.248
Jan 21 12:23:12: DHCPD: htype 1 chaddr 0012.1770.5574
Jan 21 12:23:12: DHCPD: lease time remaining (secs) = 7200
…
and so on …
The “lease time remaining (secs) = 7200″ means a 2 hours lease, am I right ?
Why does the c1801 every hour this check and not as I expected every 2 hours?
Best regards,
Marcel Koudstaal.
Cisco IOS Router Acting as a DHCP Server
This is not a check sequence. Actually every hour the lease is renewed that is why you see a notification every hour. The lease time is 2 hours. Your device every hour renews its lease. If it fails to do so, then after 1 hour it will remove its lease and request for a new lease (new IP address)
Thanks Stelios Antoniou … that indeed must be the explanation. I just did not think about this device be the one renewing the lease it got every hour.
I am a bit to cisco-minded I am afraid
great explanation!
you are gifted man! in explaining things!
you make complicated things simple!
where do i get your other articles?
thnx
Can Anyone help me that why i can not ping default gateway address 96.52.160.1
I am kind of frustrate that it looks everything OK to me but since last one week day and night i am trying to figure out that why it can not ping ISP and neither can open webpage (DNS are entered correctly)
PC————————-Cisco 1600-Router—————————————-ISP
192.168.1.2 192.168.1.1 96.52.160.200 96.52.160.1
1600_Router#sh run
Building configuration…
Current configuration : 787 bytes
!
version 12.1
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname 1600_Router
!
logging buffered 4096 debugging
!
ip subnet-zero
no ip finger
!
interface Ethernet0
ip address 96.52.160.200 255.255.252.0
ip nat outside
!
interface Serial0
ip address 192.168.1.1 255.255.255.0
ip nat inside
clockrate 500000
!
router rip
network 96.0.0.0
network 192.168.1.0
!
ip nat inside source list 10 interface Ethernet0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 96.52.160.1
no ip http server
!
access-list 10 permit 192.168.0.0 0.0.255.255
!
end
well, i can ping your routers DG, the 96.52.160.1, from where i am.
so according to your config, you either have your IPs mixed up between your two interfaces or you have a wrong subnet mask. i believe it should be the first option.
serial interfaces often dont connect to PCs, but they can in certain rare setups which i am not about to presume.
I’m just started a Wan Class and I am very interested in this, Where can I get a list of Cisco router commands so I can use it for practice with my class?
Thank you,
Chuck B
I want to configure some Cisco 29xx switches by using DHCP and TFTP followed by some manual editing. The IOS manual says the switch uses DHCP if it has no config.text, so once the configuration has been downloaded and saved, it won’t use DHCP again unless I choose to reset it.
The problem is that although the switch gets its IP address from the DHCP server, it doesn’t take its host name, default gateway, or name server addresses. The information is in the DHCP server but it doesn’t end up in the switch. Here’s the DHCP server entry:
host switch-a {
hardware ethernet 00:11:93:e5:8f:84;
fixed-address switch-a;
option host-name switch-a;
option domain-name-servers 11.22.33.44, 11.22.33.55;
}
(I know the host-name option is not required – I’ve tried it both ways.)
Any suggestions?
If a pc that is running dhcp, has received an ip address reboots his pc , will the lease be broken and a new dhcp request sent by the pc?
So,thanks this about information
I am ask the question how to network speed same in workgroup pc.
please submit the solution………….OK by………………..
But is there any way to specify the “Subnet Mask” client will receive?
I configured but my client (client router) getting only /32 IP address