RFC 2131: DHCP: Automatic IPv4 configuration
Summary
In March 1997, Ralph Droms specified the Dynamic Host Configuration Protocol in RFC 2131, which automatically assigns hosts their IPv4 address and other network parameters. DHCP builds on BOOTP but adds time-limited leases and delivers the entire IP configuration. The text itself states that DHCP in this form is quite insecure.
Four messages to an address
A client without an address sends a DHCPDISCOVER by broadcast, servers answer with DHCPOFFER, the client chooses an offer with DHCPREQUEST, and the chosen server confirms with DHCPACK. Servers listen on UDP port 67, clients on port 68. Relay agents from the BOOTP world pass broadcasts across subnet boundaries, so that one central server can serve many networks.
RFC 2131 knows three kinds of allocation: automatic and permanent, dynamic with a lease, and manual by the administrator. The client must renew a lease; by default it tries its own server after half the lease time (T1) and any server after 87.5 percent (T2). Servers should check an address before handing it out, for example with ICMP echo, and clients should probe it with ARP.
Honest about its own weakness
The security section is remarkably frank: because DHCP sits directly on UDP and IP and is meant precisely for hosts without passwords or keys, it is quite insecure in its current form. Unauthorised servers could easily be set up and could hand out false addresses, routers or name servers.
That is still the core of the rogue DHCP problem in LANs and Wi-Fi networks. The remedy lies not in the protocol but in the infrastructure: DHCP snooping on switches only accepts server replies from designated ports.
Ideas
- Clients find servers by broadcast without knowing anything beforehand.
- Leases lend addresses for a time instead of permanently.
- Renewal starts after half the lease time.
- Options deliver gateway, DNS servers and many other parameters.
- Relay agents connect several subnets to one central server.
- DHCP contains no protection against false servers.
Insights
- Automation shifts criticality: if DHCP fails, no new device gets onto the network.
- A protocol meant to work without prior configuration can hardly trust its counterpart; protection must then come from the network.
Facts
- RFC 2131 appeared in March 1997 and replaces RFC 1541.
- DHCP servers use UDP port 67, clients port 68.
- By default T1 is half and T2 87.5 percent of the lease time.
- The options themselves are described in the companion document RFC 2132.
References
- RFC 2131: Dynamic Host Configuration Protocol
- RFC 2132: DHCP Options and BOOTP Vendor Extensions (1997)
- RFC 8415: Dynamic Host Configuration Protocol for IPv6 (DHCPv6) (2018)
Critique
- Authentication is missing; RFC 2131 names the problem itself but does not solve it, and later approaches such as RFC 3118 did not catch on in practice.
Remarks
- DHCP deliberately kept the BOOTP message format so that existing BOOTP relays kept working and BOOTP clients could be served; the predecessor document RFC 1541 appeared in October 1993.
Recommendations
- Run two DHCP servers with coordinated ranges or failover.
- Enable DHCP snooping on access switches and mark only uplinks as trusted.
- Adapt lease times to the network: short in guest Wi-Fi, longer in fixed office networks.
Read the RFC at the RFC Editor
Found a mistake or have something to add? Get in touch.
Links to the original source and the Web Archive open in a new tab.