DHCP

Dynamically assigns IP addresses and network configuration to devices automatically

DHCP (Dynamic Host Configuration Protocol)

  • Automatically assigns IP addresses and network configuration to devices on a network to eliminate manual configuration
  • Operates on client-server model where DHCP server maintains pool of available IP addresses and leases them to requesting clients
  • Uses UDP ports 67 (server) and 68 (client) for communication
  • Prevents IP address conflicts by tracking which addresses are assigned and for how long

DHCP Process (DORA)

  • Discover: Client broadcasts DHCP Discover message to find available DHCP servers
  • Offer: Server responds with DHCP Offer containing available IP address and configuration parameters
  • Request: Client broadcasts DHCP Request to accept specific server’s offer
  • Acknowledge: Server sends DHCP ACK confirming lease and finalizing configuration

Key Configuration Parameters

  • IP Address: Primary address assigned to client from configured pool
  • Subnet Mask: Defines network portion of IP address
  • Default Gateway: Router IP for reaching other networks
  • DNS Servers: Domain name resolution servers (primary and secondary)
  • Lease Duration: Time period client can use assigned IP (typically 24 hours to 8 days)
  • Domain Name: Local domain suffix for name resolution

DHCP Relay Agent

  • Forwards DHCP requests across subnets since DHCP uses broadcast traffic (doesn’t cross routers by default)
  • Router interface configured with ip helper-address <DHCP-server-IP> command
  • Converts broadcast to unicast when forwarding to DHCP server
  • Essential for centralized DHCP server serving multiple VLANs/subnets

Vocabulary

  • Lease: Time-bound assignment of IP address to client device
  • Scope: Range of IP addresses available for DHCP assignment on specific subnet
  • Binding: Association between client MAC address and assigned IP address
  • Helper Address: Router configuration directing DHCP broadcasts to specific server

Notes

  • DHCP servers should have static IP addresses to ensure consistent availability
  • Always exclude static device IPs from DHCP pools to prevent conflicts
  • Multiple DHCP servers can serve same subnet for redundancy, but requires careful coordination
  • Client retries lease renewal at 50% of lease duration, then broadcasts at 87.5% if original server unavailable