Knowledge base

DHCP explained — DORA, leases and address pools

DHCPv4 messages, options, lease renewal, relay, pool planning, troubleshooting, and security.

By the end of this guide, you will be able to design a safe address pool and identify the stage at which a client fails to receive its settings. In the example network 192.168.1.0/24, we will keep the gateway and static devices outside the dynamic pool .50–.200. DHCP means Dynamic Host Configuration Protocol: a client asks a server for an IPv4 address and other settings. RFC 2131 defines the base protocol, RFC 2132 defines many original options, and IANA maintains the evolving option registry.

Core terms

  • Scope or pool: addresses available for dynamic assignment.
  • Lease: a time-limited right to use an address.
  • Exclusion: an address the server must not assign dynamically.
  • Reservation: a binding between a client identifier and an expected address.
  • Option: another setting such as mask, router, DNS, or domain name.

The DORA exchange

  1. DHCPDISCOVER: a client looks for servers.
  2. DHCPOFFER: a server proposes an address and settings.
  3. DHCPREQUEST: the client selects an offer or requests renewal.
  4. DHCPACK: the server confirms the lease; it may use DHCPNAK to reject an invalid request.

DORA is a teaching mnemonic. The real exchange depends on client state; reuse and renewal do not always start with the full four-message process.

Lease renewal

RFC 2131 defines T1 and T2. By default, a client tries unicast renewal around half the lease time (T1), then enters a broader rebinding phase at T2. It must stop using the address after expiry. Short leases reclaim guest addresses faster but increase traffic and server dependence. Long leases suit stable networks but return addresses more slowly.

Relay across VLANs

Initial client messages are local to the segment and are not forwarded as ordinary broadcasts. A relay agent on a layer-3 interface forwards the request and identifies the client's subnet, allowing one server to serve multiple networks. Each VLAN still needs the correct scope and return routing.

Planning 192.168.1.0/24

The conventional host range is 192.168.1.1–192.168.1.254. Suppose the gateway is .1, static infrastructure uses .2–.49, and the dynamic pool is .50–.200. That pool contains 151 addresses. .201–.254 remains unassigned until the plan gives it a purpose.

The DHCP pool generator always sets aside the first host address as its suggested gateway; the form has no gateway override. Reproduce the pool above with 192.168.1.0/24, 48 exclusions after the gateway (.2–.49), and 54 at the end (.201–.254). You can choose a different gateway in your actual addressing plan and router or DHCP server configuration. Adjust exclusions to that plan; the calculator's suggestion does not configure devices.

Exclusion, reservation, and static address

An exclusion merely prevents dynamic assignment. A reservation is still served by DHCP and requires a DHCP client. A static address is configured on the device and should be outside the pool or reliably excluded. Confusing the three is a common source of duplicates.

Troubleshooting

  1. Check the physical link, VLAN, and whether the client started DHCP.
  2. Confirm the pool is not exhausted and matches the subnet.
  3. Trace Discover, Offer, Request, and Ack in a packet capture.
  4. Across networks, check the relay, helper address, ACLs, and routing.
  5. Verify mask, router, DNS, and lease-time options.

A 169.254.x.x address often indicates IPv4 link-local configuration after DHCP failed, but the address alone does not identify one root cause.

Security

A rogue server can supply a malicious gateway or DNS server, while pool exhaustion can deny service. Managed switches may provide DHCP snooping, port limits, and trusted uplinks. Deploy these according to the platform documentation; they do not replace segmentation and monitoring.

A little network lab

A DHCP pool inside a smaller /26

In 172.16.2.128/26, set aside the first host for the gateway, the next 10 addresses for static devices, and the final 5 outside the dynamic pool.

Example result172.16.2.140–172.16.2.185 · 46Open example in calculator
  1. Hosts are .129–.190; .128 is network and .191 is broadcast. The generator convention selects .129 as gateway because it is this subnet’s first host.

  2. The 10 addresses after the gateway are .130–.139. The final five are .186–.190. The dynamic pool therefore starts at .140 and ends at .185.

  3. 185 − 140 + 1 = 46 simultaneous leases with one address per client. This is fewer than the /26’s 62 hosts because the gateway and exclusions occupy 16 slots.

Your turn

You need 47 leases and still want five exclusions at the end. How can the plan change if one static address can be released?

Show answer and explanation

Reduce exclusions after the gateway from 10 to 9. Pool .139–.185 gives 47 addresses. First verify that .139 is no longer statically assigned.

Official documents

Standards & sources

Sources checked:

The date refers to checking the listed documents and registries, not endorsement by their authors. Calculation assumptions and limits appear with the result. How we prepare the material.