DHCP is a network service that automatically assigns IP addresses and other IP parameters to clients using a central server, with a relay agent across subnets if needed.

Facts

Topic Fact
Transport UDP
Server port UDP 67
Client port UDP 68
IPv4 process DORA (Discover, Offer, Request, Acknowledge)
Broadcast The client always starts with broadcast
Lease Time-limited IP assignment
Relay Used when the server is in another subnet
Cisco relay command ip helper-address
CCNP focus Troubleshooting, relay, options, binding table

DHCP roles

DORA (IPv4)

  1. Discover: client → broadcast – “is there a DHCP server?”
  2. Offer: server → client – “here is an IP, want it?”
  3. Request: client → broadcast – “I want THIS IP”
  4. Acknowledge: server → client – “the IP is yours, lease starts now”

Lease renewal (CCNP)

Time Action
50 % Unicast Request to the server
87.5 % Broadcast Request
Expired New DORA process

Problem & solution

Special considerations

DHCP relay in depth (CCNP)

Client sends Discover (broadcast) → router receives → router unicasts to the server → server replies to the relay → relay forwards to the client. ip helper-address also forwards: TFTP (69), DNS (53), TACACS (49), NetBIOS and more.

Configuration

! DHCP server (router) – full pool
ip dhcp excluded-address 192.168.10.1 192.168.10.20
ip dhcp pool VLAN10
 network 192.168.10.0 255.255.255.0
 default-router 192.168.10.1
 dns-server 8.8.8.8 1.1.1.1
 domain-name firma.local
 lease 7
! network = subnet matched against GIADDR/interface
! default-router = option 3, dns-server = option 6, lease in days

! Multiple pools – router picks by subnet / GIADDR
ip dhcp excluded-address 192.168.20.1 192.168.20.10
ip dhcp pool VLAN20
 network 192.168.20.0 255.255.255.0
 default-router 192.168.20.1
 dns-server 8.8.4.4

! Relay (required with multiple VLANs) – inserts GIADDR so the server picks the right pool
interface vlan 10
 ip address 192.168.10.1 255.255.255.0
 ip helper-address 192.168.100.10

! Router as client (WAN/ISP)
interface g0/0
 ip address dhcp
 no shutdown

! Option 150 for IP phones (CCNP)
ip dhcp pool VOICE
 network 192.168.30.0 255.255.255.0
 default-router 192.168.30.1
 option 150 ip 192.168.100.5

DHCP options (CCNP)

Option Name Function Typical use
43 Vendor-specific information Vendor data AP / WLC discovery
60 Vendor class identifier Identifies client type IP phones / APs
66 TFTP server name TFTP server (hostname/IP) PXE / IP phones
67 Bootfile name Boot file PXE boot
82 Relay agent information Inserted by the relay Security / tracking
150 TFTP server address Cisco IP phone TFTP Voice VLAN (preferred over 66)

Verification & troubleshooting

show ip dhcp binding
show ip dhcp pool
show ip dhcp server statistics
show running-config | section dhcp
debug ip dhcp server events
debug ip dhcp relay

Typical faults: missing ip helper-address, wrong VLAN/interface, pool not matching the subnet, DHCP snooping blocking offers. In ACLs permit DHCP with:

permit udp any any eq bootpc
permit udp any any eq bootps