Loading content...
When a DHCP server grants an IP address, it doesn't give it permanently—it leases it. This temporary assignment is the key innovation that enables dynamic addressing to work at scale. But lease management is far more complex than simply setting a timer.
Consider these questions:
Lease management encompasses the policies, mechanisms, and databases that answer these questions. It's the operational backbone of DHCP—invisible when working correctly, catastrophic when misconfigured.
This page examines lease management holistically: from the moment a lease is created through renewal, rebinding, expiration, and reclamation. You'll understand how to size lease durations, design for failure scenarios, and maintain healthy address pools.
By the end of this page, you will understand the complete lease lifecycle, database persistence mechanisms, renewal and rebinding strategies, lease duration best practices, and the server-side operations that maintain DHCP reliability.
A DHCP lease is a time-bounded contract between server and client. The server agrees to not assign the IP address to anyone else for the lease duration; the client agrees to either renew the lease or stop using the address when it expires.
Lease Components:
A lease record in the DHCP server database typically contains:
| Field | Description | Example |
|---|---|---|
| IP Address | The leased address | 192.168.1.100 |
| Client Identifier | Unique identifier (MAC or Option 61) | 01:AA:BB:CC:DD:EE:FF |
| MAC Address | Client's hardware address | AA:BB:CC:DD:EE:FF |
| Hostname | Client-provided hostname (Option 12) | john-laptop |
| Lease Start | When the lease was granted | 2024-01-15 10:30:00 UTC |
| Lease Duration | Length of lease in seconds | 86400 (24 hours) |
| Lease Expiration | When the lease becomes invalid | 2024-01-16 10:30:00 UTC |
| Lease State | Current state (active, expired, etc.) | ACTIVE |
| Binding Type | Dynamic, automatic, or manual | DYNAMIC |
The Lease as Contract:
Understanding leases as contracts clarifies the obligations:
Server Obligations:
Client Obligations:
Breaking the Contract:
Clients that fail to renew (e.g., powered off, disconnected) technically violate the implicit contract, but DHCP accommodates this gracefully—the address simply becomes available after expiration.
The client identifier (Option 61) takes precedence over MAC address for lease binding. This allows virtual machines (which may have changing MACs) or multi-homed devices to maintain consistent identity. If Option 61 is present, the server uses it; otherwise, it falls back to the MAC address.
A DHCP lease progresses through several states during its lifetime. Understanding these states, from both client and server perspectives, is essential for troubleshooting and operations.
Server-Side Lease States:
| State | Description | Transitions To |
|---|---|---|
| Available | Address is in pool and can be assigned | Offered (when included in OFFER) |
| Offered | Address proposed to client, awaiting acceptance | Active (REQUEST received) or Available (timeout) |
| Active | Address assigned to client with valid lease | Expired (timeout) or Available (RELEASE) |
| Expired | Lease time passed, grace period active | Available (grace period ends) |
| Released | Client explicitly released address | Available (immediate or after cleanup) |
| Declined | Address rejected due to conflict | Unavailable (quarantined for investigation) |
| Reserved | Statically mapped to specific client | Active (when client requests) |
Client-Side States (from RFC 2131):
The client also maintains state that determines its behavior:
| State | Description | Next Action |
|---|---|---|
| INIT | Just started or lease lost | Send DISCOVER |
| SELECTING | Collecting OFFERs | Select offer, send REQUEST |
| REQUESTING | Awaiting ACK for selected offer | Configure interface (ACK) or restart (NAK) |
| BOUND | Lease active, network operational | Wait for T1 timer |
| RENEWING | T1 expired, attempting renewal | Unicast REQUEST to server |
| REBINDING | T2 expired, renewal failed | Broadcast REQUEST |
| INIT-REBOOT | Rebooting with cached address | Send REQUEST for cached IP |
| REBOOTING | Waiting for ACK of cached address | Configure (ACK) or DISCOVER (NAK) |
State Persistence:
Clients typically persist the assigned address and lease expiration to storage. On reboot, they can attempt INIT-REBOOT to quickly reclaim their previous address without full DORA.
Lease renewal is the routine maintenance that keeps DHCP leases active. Properly functioning renewal ensures clients never lose connectivity due to lease expiration during normal operation.
The T1 Timer (Renewal Time):
T1 is typically set to 50% of the lease duration (or specified by Option 58). When T1 fires:
Why Unicast?
Renewal Success:
If the server receives the renewal REQUEST and can honor it:
Renewal Failure Handling:
If the server cannot be reached or responds with NAK:
Renewal Best Practices:
Renewal ACKs can include updated options. If your DNS server changes, configure it on the DHCP server—clients will receive the new address at their next renewal (within T1 time). This is one reason shorter leases enable faster configuration propagation.
When renewal fails—because the original server is unreachable—the client has one more chance before losing its address: rebinding. This mechanism provides resilience against server failures.
The T2 Timer (Rebinding Time):
T2 is typically set to 87.5% of the lease duration (or specified by Option 59). When T2 fires:
Why 50% and 87.5%?
These defaults create a structured failure response:
| Timer | % of Lease | Purpose |
|---|---|---|
| T1 | 50% | Early renewal, plenty of time for retries |
| T2 | 87.5% | Failover to any server, still time before expiration |
| Expiration | 100% | Address no longer valid |
For a 24-hour lease:
Rebinding Server Processing:
When a DHCP server receives a broadcast REQUEST in the REBINDING context:
Server checks if it has the lease
If address is valid and available:
If address is invalid for this network:
If address conflicts with another lease:
Clients entering REBINDING state indicate a potential problem: the primary server is unreachable. Monitor for excessive rebinding traffic—it often signals server failure, network path issues, or misconfiguration. Healthy networks should see almost no rebinding activity.
The Grace Period:
Many DHCP server implementations provide a grace period after lease expiration before returning the address to the pool:
During the grace period:
The DHCP server must persist lease information across restarts, crashes, and even hardware failures. Without persistence, a server restart would lose all lease records—potentially causing address conflicts when new addresses are assigned to devices that still hold their previous leases.
Lease Storage Mechanisms:
File-Based Lease Database:
Many DHCP servers (ISC DHCP, dnsmasq) store leases in text files:
# ISC DHCP Lease File Format (dhcpd.leases)
lease 192.168.1.100 {
starts 4 2024/01/15 10:30:00;
ends 4 2024/01/16 10:30:00;
binding state active;
next binding state free;
hardware ethernet aa:bb:cc:dd:ee:ff;
client-hostname "john-laptop";
}
Advantages:
Disadvantages:
Write Behavior:
Always backup DHCP lease databases as part of disaster recovery. A corrupted or lost lease database means the server doesn't know which addresses are in use—leading to potential conflicts until all clients naturally expire and re-acquire addresses.
Configuring the right lease duration is one of the most important—and often overlooked—DHCP decisions. Too short wastes resources; too long exhausts pools and delays configuration updates.
Factors Influencing Lease Duration:
| Environment | Suggested Lease | Rationale |
|---|---|---|
| Coffee Shop / Hotspot | 30 minutes - 2 hours | Customers visit briefly; reclaim addresses quickly |
| Conference / Event | 1 - 4 hours | Attendees present for limited time; balance address availability with stability |
| Corporate Office | 8 - 24 hours | Employees present for workday; addresses stable during use |
| Home Network | 24 hours - 7 days | Few devices, stable population; minimal churn |
| Wired Desktop Lab | 1 - 7 days | Machines rarely move; benefit from stable addresses |
| Guest WiFi | 2 - 8 hours | Transient visitors; balance security with convenience |
| IoT Devices | 1 - 7 days | Stable devices; minimize traffic on constrained networks |
Calculating Optimal Lease Duration:
A practical formula for minimum lease duration:
Minimum Lease = (Address Pool Size / Peak Device Count) × Average Session Duration
Example:
Minimum Lease = (200/150) × 2 hours = 2.67 hours
With safety margin: 3-4 hours recommended
Warning Signs of Wrong Lease Duration:
Too Short:
Too Long:
Consider different lease durations for different device classes. Use DHCP classes or vendor IDs to assign longer leases to workstations and shorter leases to mobile devices. This optimizes both pool utilization and network traffic.
A single DHCP server is a single point of failure. When it goes offline, no new devices can join the network, and existing devices risk losing addresses when their leases expire. Enterprise deployments require high availability strategies.
Failover Approaches:
Split Scope (80/20 Rule):
The simplest failover approach: divide the address pool between two independent servers.
Implementation:
Behavior:
Advantages:
Disadvantages:
Best For:
Ensure failover functionality is tested regularly. A failover configuration that hasn't been tested may fail when actually needed. Periodically bring down the primary server during a maintenance window and verify that clients can still obtain and renew addresses from the secondary.
We've comprehensively examined DHCP lease management—the operational backbone that makes dynamic addressing reliable. Let's consolidate the key takeaways:
What's Next:
With lease management understood, the final page examines DHCP relay agents—the mechanism that enables DHCP to work across routed network segments. Relay agents are essential for enterprise deployments where clients and servers reside on different subnets.
You now understand the complete lease lifecycle, from assignment through renewal, rebinding, and expiration. This knowledge enables you to configure appropriate lease durations, design resilient DHCP infrastructure, and troubleshoot lease-related issues effectively.