Infrastructure

DHCP (Dynamic Host Configuration Protocol)

Dynamic Host Configuration Protocol

DHCP is the protocol that automatically assigns IP addresses to devices on a network. Your router runs a DHCP server that hands out addresses when devices connect.

DHCP (Dynamic Host Configuration Protocol) is the network protocol that automatically configures devices with an IP address, subnet mask, default gateway, and DNS server when they join a network. Without DHCP, each device would need to be manually configured with these values before it could connect.

The DORA handshake

Every DHCP assignment follows a four-step process known as DORA — Discover, Offer, Request, Acknowledge:

  • Discover — the new device broadcasts to 255.255.255.255 asking for a DHCP server. It has no IP address yet, so it uses 0.0.0.0 as the source.
  • Offer — the DHCP server (your router) reserves a free address from its pool and offers it to the device along with a proposed lease duration, subnet mask, gateway, and DNS servers.
  • Request — the device broadcasts its acceptance of the offered address (broadcasting ensures other DHCP servers on the network know their offer was not accepted).
  • Acknowledge — the server confirms the assignment. The device configures its network stack and is ready to communicate.

The entire DORA exchange typically completes in under 100 milliseconds on a local network.

DHCP lease time and renewal

Addresses are not assigned permanently — each lease has an expiry time, typically 24 hours on consumer routers. When 50% of the lease time has elapsed, the device silently attempts to renew directly with the same server. If that fails, at 87.5% of the lease it will try any available server. If the lease expires with no renewal, the address returns to the pool and the device must restart DORA from scratch. Short lease times help recover addresses quickly from devices that leave without explicitly releasing (phones, IoT devices). Longer leases reduce broadcast traffic on busy networks.

DHCP scope and options

The DHCP scope is the pool of addresses the server can hand out, along with any exclusions. A typical home router scope might be 192.168.1.100–192.168.1.200, reserving lower addresses for manual assignment. Beyond the IP address, a DHCP server delivers options to the client:

  • Option 3 — default gateway (your router's LAN IP)
  • Option 6 — DNS server addresses
  • Option 42 — NTP server for time synchronisation
  • Option 51 — lease time in seconds

Enterprise DHCP servers use dozens of additional options to push VPN configuration, boot server addresses, and domain search lists to managed clients.

DHCP reservations (static DHCP)

A DHCP reservation binds a fixed IP address to a specific MAC address. When that device connects, it always receives the same IP — without any manual configuration on the device itself. This is the recommended approach for devices that need stable addresses: NAS drives, printers, home servers, and anything with port-forwarding rules pointing at it. You create a reservation in your router's admin panel by pairing the device's MAC address with the desired IP. The IP must fall within or be explicitly excluded from the dynamic pool to avoid conflicts.

DHCP relay agents

DHCP Discover broadcasts do not cross router boundaries. In a network with multiple VLANs, each subnet would need its own DHCP server — unless a DHCP relay agent (also called a DHCP helper) is configured. The relay agent runs on a Layer 3 switch or router and forwards DHCP broadcasts as unicast packets to a central DHCP server, inserting the client's originating subnet in the packet so the server knows which address pool to draw from. This is how enterprise networks serve hundreds of VLANs from a single DHCP server.

DHCPv6 and SLAAC

IPv6 networks have two address assignment mechanisms. DHCPv6 works similarly to DHCPv4 — a server hands out addresses and options. SLAAC (Stateless Address Autoconfiguration) lets a device construct its own IPv6 address by combining the /64 network prefix advertised by the router with a locally generated host identifier. SLAAC requires no server at all. Many networks use both: SLAAC for address assignment and DHCPv6 just to push DNS server addresses (stateless DHCPv6).

Viewing DHCP leases

Your router's admin panel (typically at 192.168.1.1 or 192.168.0.1) has a DHCP lease table showing every active assignment: device name, MAC address, assigned IP, and remaining lease time. This is useful for identifying unknown devices, troubleshooting connectivity, or finding the IP to create a reservation. On Windows, ipconfig /all shows your current lease details including the DHCP server address and expiry time.

Common DHCP failures

The most frequent failure is an exhausted address pool — the server has handed out every address in the scope and cannot assign a new one. Symptoms appear on new devices trying to join: they fall back to an APIPA address in the 169.254.0.0/16 range, which is only link-local and cannot reach the internet. Windows shows "No internet, secured" or "Limited connectivity." Fix by expanding the scope, shortening lease times, or restarting the router to flush stale leases. A rogue DHCP server — another device on the network responding to Discover messages — hands out wrong gateway or DNS addresses, silently breaking internet access for affected clients. Managed switches prevent this with DHCP snooping, which allows DHCP replies only on trusted ports.

Frequently Asked Questions

What happens if DHCP fails?

The device falls back to an APIPA address (169.254.x.x), which cannot reach the internet or other network devices. Common symptoms: 'No internet, secured' or 'Limited connectivity' on Windows. Fix by restarting the router (resets the DHCP server) or running ipconfig /release and ipconfig /renew.

Should I use static IPs instead of DHCP?

DHCP reservations (static DHCP) give you the best of both — automatic assignment on new devices plus stable addresses for devices that need them (for port forwarding, NAS, printers). Fully manual static IPs on every device create management overhead with no benefit for home networks.

Related Terms

More From This Section