Today I am going to talk about the most interesting topic named as DHCP. I knew lot of you guys already knew about the DHCP and how it works in the real network environment but some of you are the beginners in the field of networking and this is why it is one of the most important topic for them.

Why we use the DHCP server and what is the purpose of the DHCP ?

Well Routers, servers, other key nodes require specific or static IP address and Clients can use an IP from a pool of available addresses. Minimum host configuration for Internet:
  • IP address
  • Subnet mask
  • Default gateway
  • DNS server IP
DHCP allows network administrator to assign a pool of available IP addresses for clients with additional configuration information such as default gateway, DNS IP, WINS IP, domain names
Addresses are leased, Cisco default is 24 hours

Fig 1.1- DHCP Server


DHCP process
·      Client boots up, sends a DHCPDISCOVER broadcast
·      All available DHCP servers respond with DHCPOFFER containing proposed IP address, lease time, DNS IP; server checks that IP offered is not in use before making the offer by issuing a default 2 pings
·      Client responds to first offer with DHCPREQEST broadcast
·      Server matching request sends DHCPACK and records lease; all other servers withdraw offers
·      If client detects the address is already in use it sends DHCPDECLINE and starts process over

Fig 1.2- DHCP Server and Client


Configure DHCP

Enabled by default
Disable with no service dhcp
Re-enable with service dhcp
1.  Global configuration mode
ip dhcp pool pool-name
2.  Within DHCP configuration mode:
(a)  Must define pool of available IP addresses, must be in same subnet
network ip-address [ mask | /prefix-length ]
(b)  Can assign default gateway, domain name, DNS server IP, WINS server IP
default-router gateway-addr
domain-name domain
dns-server ip-addr
netbios-name-server ip-addr
lease [days][hours][minutes]
3.  Can exclude range of addresses from pool, global configuration mode
ip dhcp excluded-address ip-addr [end-ip-range]

Verify DHCP operation
show ip dhcp binding
show ip dhcp conflict
show ip dhcp database
show ip dhcp statistics

Troubleshoot DHCP operation
debug ip dhcp server events
debug ip dhcp server packets
debug ip dhcp server linkage


DHCP Relay
DHCP uses broadcast which requires a DHCP server to reside in each network segment
·      Server overhead
·      Administrative nightmare
·      Other critical services also use broadcast – TFTP, DNS
Cisco IOS helper address = relay agent
·      Intercepts UDP broadcasts and forwards to specific IP address (server on another segment)
·      For DHCP, fills router IP address as gateway IP; DHCP assigns address from pool with same subnet as gateway IP

Configure DHCP relay
Interface mode for clients needing DHCP service

  ip helper-address dhcp-ip-addr