Skip to content
networking protocols

DHCP (DHCP)

dhcp protocols ip-addressing infrastructure
Plain English

DHCP is like a receptionist at a hotel front desk. When you walk in (connect to a network), the receptionist assigns you a room number (IP address), tells you where the elevator is (gateway), and gives you the Wi-Fi password (DNS server). You do not have to configure anything yourself; it all happens automatically.

Technical Definition

Dynamic Host Configuration Protocol (DHCP) is defined in RFC 2131 (IPv4) and RFC 8415 (DHCPv6). It automates the assignment of IP addresses, subnet masks, default gateways, DNS servers, and other network parameters to clients joining a network.

DHCP uses a four-step process known as DORA:

  1. Discover (client → broadcast): the client sends a UDP broadcast on port 67 from source 0.0.0.0 to destination 255.255.255.255, requesting an address
  2. Offer (server → client): the DHCP server responds with an available IP address and lease parameters
  3. Request (client → broadcast): the client accepts the offer by broadcasting a request for that specific address (important when multiple DHCP servers exist)
  4. Acknowledge (server → client): the server confirms the lease and provides the full configuration

Key concepts:

  • Lease time: how long the client may use the assigned address before renewing (T1 = 50% of lease for renewal attempt, T2 = 87.5% for rebind)
  • Scope: the range of addresses a server can assign
  • Reservation: a static mapping of MAC address to IP address within a scope
  • DHCP relay (ip helper-address): forwards DHCP broadcasts across subnets to a centralized server
  • Option 82: relay agent information for identifying the physical port a client connected to

DHCP operates over UDP port 67 (server) and UDP port 68 (client).

ClientNo IP yetDHCP Server192.168.1.11. DiscoverBroadcast2. Offer192.168.1.1003. RequestAccept offer4. AcknowledgeLease grantedUDP ports 67 (server) / 68 (client)

DHCP lease inspection (Linux)

$ cat /var/lib/dhcp/dhclient.leases
lease {
  interface "eth0";
  fixed-address 192.168.1.100;
  option subnet-mask 255.255.255.0;
  option routers 192.168.1.1;
  option domain-name-servers 8.8.8.8, 8.8.4.4;
  option domain-name "home.lan";
  renew 3 2026/04/16 12:00:00;
  rebind 4 2026/04/17 06:00:00;
  expire 4 2026/04/17 12:00:00;
}
In the Wild

Every time you connect a phone to Wi-Fi, plug a laptop into an Ethernet port, or spin up a VM, DHCP is doing the work behind the scenes. In enterprise networks, DHCP servers are often integrated with DNS (Dynamic DNS updates) so that hostnames automatically resolve to newly assigned addresses. DHCP relay agents are critical in routed networks where the DHCP server sits on a different VLAN than the clients. Rogue DHCP servers (unauthorized servers handing out bad configurations) are a common network security issue, mitigated by DHCP snooping on managed switches. Troubleshooting “APIPA address” (169.254.x.x) on a Windows machine almost always points to a DHCP failure.