Senior 9 min · March 06, 2026

DHCP Scope Exhaustion — Why 50 IoT Devices Killed a Network

A 7-day lease default exhausted a DHCP pool when 50 IoT devices joined.

N
Naren · Founder
Plain-English first. Then code. Then the interview question.
About
 ● Production Incident 🔎 Debug Guide
Quick Answer
  • DHCP automates IP address assignment: devices get a lease from a server
  • Four-step DORA process: Discover, Offer, Request, Acknowledge
  • Lease time governs how long an IP is valid; renewals happen at 50% and 87.5%
  • DHCP options deliver subnet mask, gateway, DNS servers, and more
  • Production failure: scope exhaustion blocks new devices silently
  • Biggest mistake: assuming static IPs are always better — they bypass DHCP management
  • APIPA (169.254.x.x) indicates DHCP failure — client falls back to link-local
  • Rogue DHCP servers can MITM your subnet — DHCP snooping is essential
Plain-English First

Imagine you walk into a hotel. You don't bring your own room number from home — the front desk assigns you one for your stay, gives you a key, tells you where the restaurant is, and takes the room back when you check out. DHCP does exactly that for devices on a network. Instead of a room number, your device gets an IP address. Instead of a front desk clerk, there's a DHCP server. The moment you connect to Wi-Fi, this invisible check-in process happens in milliseconds — and you never have to think about it.

Every time you join a coffee shop Wi-Fi, plug into your home router, or spin up a cloud server, DHCP quietly hands your device an IP address without a single manual step. That automatic handoff is the Dynamic Host Configuration Protocol, and it's one of the most critical protocols on the internet. Without it, every device would need manual network config before browsing.

Before DHCP (standardised in 1993), admins manually assigned IPs to every device. In a company with 500 computers, that meant 500 trips, 500 config screens, and 500 chances for a typo that broke someone's connection. Worse, two admins could accidentally give the same IP to two machines — an IP conflict that killed both. DHCP eliminated all that pain with a central server handling address assignment automatically.

Here's what you'll walk away with: exactly how DORA works under the hood, what info DHCP pushes beyond just an IP, how to troubleshoot a failed lease, and what breaks when things go wrong. You'll be able to explain it in an interview, fix a real DHCP outage, and finally understand what your router means by 'obtaining IP address'.

What is DHCP Explained?

DHCP solves one problem: manual IP configuration. When a device joins a network, it needs a unique IP, subnet mask, default gateway, and DNS servers. Without DHCP, you'd configure each device by hand — and track assignments to avoid conflicts. DHCP automates this by leasing IPs for a limited time.

Think about scale: an enterprise with 10,000 devices would need an entire team just for static IP management. DHCP handles that in milliseconds per request, with zero human error. The trade-off? You now depend on a server. If it's down, new devices can't join. That's why redundancy matters.

Here's the thing: DHCP doesn't just hand out IPs. It also pushes options like DNS servers and gateway. One wrong option value can silently break connectivity. We'll cover that later.

dhcp_check.shBASH
1
2
# Check if DHCP server is reachable (TheCodeForge style)
sudo nmap -sU -p 67 --script=dhcp-discover 192.168.1.1
Output
Starting Nmap ...
Nmap scan report for 192.168.1.1
Host is up (0.0010s latency).
PORT STATE SERVICE
67/udp open|filtered dhcps
MAC Address: 00:1A:2B:3C:4D:5E (Router)
Real talk:
Type these commands yourself. The muscle memory matters when you're on a PagerDuty call at 2 AM.
Production Insight
DHCP failure breaks all network connectivity.
The most common issue is scope exhaustion — running out of IP addresses.
Rule: always monitor pool utilization and set alerts at 80%.
Key Takeaway
DHCP eliminates manual IP config but introduces server dependency.
Plan scope sizes based on peak device count plus 20% headroom.
Lease time affects pool turnover — too long wastes addresses, too short creates churn.

The DORA Process: How DHCP Works Step by Step

DORA stands for Discover, Offer, Request, Acknowledge. When a device boots, it broadcasts a DHCP Discover on the local network. The server hears it and responds with an Offer that includes a potential IP, subnet mask, lease duration, and options. The client then sends a Request explicitly asking for that offered address. Finally, the server sends an Acknowledge, confirming the lease.

This whole exchange happens in under a second — usually. The Discover uses UDP broadcast to port 67, so it reaches all DHCP servers on the same Layer 2 segment. If the server is on a different subnet, a DHCP relay agent forwards the broadcast as a unicast. That's a detail that'll trip you up if you ever set up DHCP across VLANs.

One nuance: after the Acknowledge, the client may send a DHCP Decline if it detects the offered IP is already in use (via gratuitous ARP). This rare step prevents duplicate addresses, but if it happens often, you've got a network misconfiguration.

capture_dora.shBASH
1
2
3
# Capture DHCP traffic to see DORA in action
sudo tcpdump -i eth0 -n port 67 or port 68 -e -v
# Look for: DISCOVER, OFFER, REQUEST, ACK
Output
12:34:56.789012 00:1a:2b:3c:4d:5e > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: 0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 00:1a:2b:3c:4d:5e, length 300
DORA as a Rental Agreement
  • Discover = you walking through the neighborhood looking for 'For Rent' signs
  • Offer = landlord says 'Apartment #10 is available for $800/month for 6 months'
  • Request = you fill out the application and say 'Yes, I'll take #10'
  • Acknowledge = landlord hands you the keys and the rules (options like DNS/gateway)
Production Insight
If the DHCP server is on a different subnet without a relay agent, offers never reach the client.
The client waits for DHCPOFFER until timeout (30-60 seconds) and falls back to APIPA.
Rule: always verify 'ip helper-address' (Cisco) points to the correct server before troubleshooting client side.
Key Takeaway
DORA is a four-step handshake that guarantees a unique, valid IP lease.
Failure at any step means no connectivity — capture traffic to see which step fails.
It's the fastest debug path: packet capture reveals the broken step immediately.
DHCP Message Flow Diagnosis
IfClient sends DISCOVER but receives no OFFER
UseCheck if DHCP server is reachable (ping), if relay agent is configured (if cross-subnet), and if server has available leases.
IfClient sends REQUEST but receives no ACK
UseServer may have already assigned the IP to another device (race condition) or client ID mismatch. Check server logs for 'decline' or 'nak'.
IfClient receives ACK but still has no connectivity
UseThe gateway or DNS option in the DHCP offer is misconfigured. Verify the options sent by the server.

DHCP Options: Beyond IP Addresses

DHCP doesn't just hand out an IP. The server sends a set of configuration parameters called options. Here are the critical ones: • Option 1: Subnet Mask • Option 3: Router (Default Gateway) • Option 6: Domain Name Servers • Option 15: Domain Name • Option 51: Lease Time • Option 53: Message Type • Option 54: Server Identifier • Option 121: Classless Static Routes

These options are defined by IANA and are extensible. Enterprise deployments often use vendor-specific options to push proxy PAC URLs or certificate server locations. A misconfigured option can silently break an entire subnet — for instance, giving out a wrong DNS server makes 'google.com' unreachable, but everything else works.

Watch out for Option 82 (Relay Agent Information) — used in DHCP snooping to identify which switch port a request came from. If your switch strips or modifies this option, the server may reject requests or assign wrong scopes.

Common Option Pitfall
Option 3 (router) must be the gateway IP on that subnet. If you mistakenly set it to a different subnet's gateway, clients will send all off-subnet traffic to a router that doesn't know how to route back. Symptom: clients get IP but cannot reach any external website.
Production Insight
The most insidious DHCP issue is a misconfigured DNS option (Option 6).
Clients get IP, can ping internal hosts by IP, but DNS fails — users report 'no internet'.
Rule: always test DNS resolution immediately after DHCP assignment using 'nslookup thecodeforge.io'.
Key Takeaway
DHCP delivers up to 254 options, from gateway to proxy settings.
One wrong option value can disable a subnet; validate all critical options in a staging lab.
Use 'dhcpdump' or capture DHCPOFFER packets to inspect the actual options clients receive.

DHCP in Production: Scopes, Leases, and Relay Agents

In a corporate network, DHCP uses scopes — ranges of addresses for each subnet. Each scope has its own lease time, options, and exclusion ranges (e.g., reserving .1-.10 for servers). When a device moves between subnets, it must get a new lease from the new scope. That's where DHCP relay agents come in.

A relay agent (router or Layer 3 switch) listens for DHCP broadcasts on a subnet, then unicasts them to the DHCP server. Without it, each subnet would need its own DHCP server. The relay agent adds the gateway IP (giaddr field) so the server knows which scope to offer from. A wrong giaddr is a common source of confusion — clients get IPs from the wrong scope or no response at all.

Lease management matters. The server tracks each lease's state: available, allocated, renewed, released, expired. At 50% of lease time, the client tries to renew with the same server. At 87.5%, it broadcasts to any server. If the server is down during renewal, the lease expires and the client loses its IP. In production, set lease times based on device mobility: 8 hours for workstations, 15 minutes for guest Wi-Fi, days for servers.

A lesser-known detail: the server also detects conflicts via gratuitous ARP. If a conflict is detected, the client sends a DHCP Decline, and the server marks that IP as bad. This can cause rapid exhaustion if misconfigured.

dhcp_lease_util.shBASH
1
2
3
4
# Check DHCP pool utilization on ISC server
sudo cat /var/lib/dhcp/dhcpd.leases | grep -c '^lease'
# Total pool size - count available? (approximate: parse pool config)
sudo grep -A5 'subnet' /etc/dhcp/dhcpd.conf | grep 'range'
Output
241
range 192.168.1.100 192.168.1.200; # 100 addresses
Production Insight
When a DHCP relay agent fails or is misconfigured, clients on that subnet get no offer.
The symptom is slow networking as clients fall back to APIPA after timeout.
Rule: include relay agent monitoring in your network health dashboard; check with 'show ip dhcp relay' (Cisco).
Key Takeaway
DHCP requires relay agents to work across subnets; the giaddr field must be the client's gateway.
Lease time management is a balancing act between address reuse and stability.
Monitor lease utilization and relay agent health to prevent silent outages.
DHCP Relay Agent Issues
IfClient broadcasts Discover, but server never receives it
UseRelay agent not configured, or UDP port forwarding disabled. Configure 'ip helper-address <server-ip>' on the client VLAN interface.
IfServer receives Discover but responds with wrong subnet
Usegiaddr field is incorrect. Check relay agent's interface IP; the giaddr must match the client's subnet.
IfServer responds, client sends Request, but server denies
UsePossible duplicate client ID or scope exhaustion. Check server logs for 'no free leases' or 'request denied'.

DHCP Security: Rogue Servers and Spoofing

DHCP was designed for a trusted network — no authentication built in. That opens the door for rogue DHCP servers: an attacker sets up a fake server on the same subnet, offering malicious IPs and gateways. Clients that accept the rogue's offer route all traffic through the attacker, enabling man-in-the-middle attacks.

Mitigation: DHCP snooping on switches monitors UDP port 67 and blocks DHCP server messages on untrusted ports. Trusted ports are where legitimate servers connect. Any DHCPOFFER on an untrusted port is dropped. Also use 802.1X authentication to ensure authorized devices only.

Another attack is DHCP starvation: an attacker floods the network with Discover messages from fake MAC addresses, exhausting the lease pool. Countermeasure: rate limiting on DHCP traffic and port security to limit MAC addresses per port.

Real story: a disgruntled employee plugged a consumer router into the network, enabling its DHCP server. Within minutes, half the floor lost connectivity because clients received a different gateway that couldn't route. Fix: enable DHCP snooping on all edge switches and configure trusted ports for the known DHCP server IP only.

Production Security Check
Run 'nmap --script=dhcp-discover' periodically to detect rogue servers. If you see DHCPOFFERs from an unexpected source, investigate immediately.
Production Insight
Rogue DHCP servers often appear during network restructures when someone connects a consumer router with DHCP enabled.
The consequence is intermittent connectivity as clients pick either the real or rogue server.
Rule: enforce DHCP snooping on all edge switches and configure trusted ports only for known server IPs.
Key Takeaway
DHCP has no built-in security — trust the network but verify with snooping and 802.1X.
A rogue DHCP server can silently MITM your entire subnet.
Starvation attacks are mitigated by rate-limiting and port security, not by increasing lease pool size.

Troubleshooting DHCP: Common Failures and Debug Commands

When DHCP fails, the symptom is often 'no network' or 'limited connectivity'. Debug systematically: start at Layer 2 (link up?), then Layer 3 (has IP? APIPA means no DHCP). Use tcpdump to see if messages are exchanged. If no Discover goes out, check the client's DHCP service. If Discover goes out but no Offer returns, the server may be unreachable or relay agent not forwarding. If Offer is seen but Request is missing, the device may have rejected the offer. If Request goes out but no ACK, the server may have allocated the IP elsewhere.

Here's a methodical checklist: 1. Verify client network cable/connection 2. 'ipconfig /release && ipconfig /renew' (Windows) or 'sudo dhclient -v' (Linux) 3. Capture traffic: 'tcpdump -i eth0 port 67 or port 68' 4. Check DHCP server logs: /var/log/syslog or /var/log/messages 5. For cross-subnet, verify relay agent configuration 6. Check scope utilization on the server 7. Check for rogue DHCP servers with a broadcast ping or scanning tools

Pro tip: for intermittent failures, set up a continuous capture with a rotating file. You'll see the pattern only when the failure occurs.

dhcp_diag.shBASH
1
2
3
4
5
6
7
8
9
#!/bin/bash
# DHCP diagnostic script for Linux (TheCodeForge)
INTERFACE="eth0"
echo "--- Releasing and renewing on $INTERFACE ---"
sudo dhclient -r $INTERFACE && sudo dhclient -v $INTERFACE
echo "--- Capturing DHCP traffic for 10 seconds ---"
sudo timeout 10 tcpdump -i $INTERFACE -n port 67 or port 68 -e -v
echo "--- Checking DHCP server logs (last 20 lines) ---"
sudo tail -20 /var/log/syslog | grep -i dhcp
Output
--- Releasing and renewing on eth0 ---
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.1.1
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.50 -- renewal in 1800 seconds.
Golden Debug Rule
When DHCP fails, always start with a packet capture. It shows whether the problem is on the client side (no Discover sent) or server side (no Offer received). Everything else is guesswork.
Production Insight
Many DHCP outages are caused by exhausted ARP cache on the relay agent or switch.
The relay agent needs to forward the broadcast, but if its CAM table is full or ARP entry for the server is stale, the unicast fails.
Rule: monitor switch CPU and ARP table size; plan for enough entries in subnets with heavy DHCP traffic.
Key Takeaway
Troubleshoot DHCP from the client out: capture reveals the broken step.
Relay agent and server logs are your best friends for cross-subnet issues.
Don't forget Layer 1 — a loose cable can prevent DHCP even if everything else is fine.

DHCPv6 and Stateful vs Stateless Configuration

IPv6 changes DHCP significantly. DHCPv6 still exists but competes with SLAAC (Stateless Address Autoconfiguration). In SLAAC, a router advertises a prefix and clients generate their own IP using EUI-64 or privacy extensions. DHCPv6 provides additional info like DNS servers. Two modes: stateless DHCPv6 (used with SLAAC to supply DNS) and stateful DHCPv6 (server assigns and tracks IPs like IPv4). Production networks often use SLAAC for IP assignment and DHCPv6 for options. A common mistake is enabling both without coordination, leading to duplicate addresses or missing DNS.

DHCPv6 uses different ports (UDP 546 client, 547 server) and a slightly different message flow: Solicit, Advertise, Request, Reply. But the concept is the same. Also, the Identity Association (IA) allows multiple addresses per interface, which complicates state tracking.

IPv6 Transition Reality
Most enterprises still use DHCPv4 internally. IPv6 deployment is growing, but you'll likely deal with dual-stack setups where both DHCPv4 and SLAAC run in parallel. Monitor both pools.
Production Insight
SLAAC works without a server, but doesn't deliver DNS — that's where stateless DHCPv6 comes in.
Without DHCPv6 option provision, clients get an IP but can't resolve names, mimicking a 'no internet' symptom.
Rule: in SLAAC environments, always deploy stateless DHCPv6 or include RDNSS in router advertisements.
Key Takeaway
DHCPv6 can be stateful or stateless; SLAAC handles IPs but not options.
IPv6 introduces new failure modes when SLAAC and DHCPv6 conflict.
Monitor both IPv4 and IPv6 DHCP pools separately in dual-stack networks.

DHCP in Cloud Environments: AWS, Azure, GCP

Cloud providers abstract DHCP away. In AWS VPC, every instance gets an IP from the VPC's CIDR via a built-in DHCP service. You can configure DHCP option sets (domain name, DNS servers) but can't control lease times. Azure VNets use Azure DHCP with custom DNS servers. GCP VPCs assign IPs via internal DHCP with options for Google-managed DNS or custom. Key insight: cloud DHCP is reliable but limited — you can't set lease times, isolate scopes, or run relay agents. Need granular control? Use static IPs or bring your own DHCP server on a VM, but that adds complexity.

A production trap: in AWS, when you add a secondary CIDR to a VPC, the DHCP service automatically expands the pool — but existing instances won't get IPs from the new range until you release and renew. Plan for that during maintenance windows.

Cloud DHCP Gotcha
In AWS, if you change the DHCP option set after instances launch, existing instances don't pick up new options until reboot or dhclient renewal. Plan changes during maintenance windows.
Production Insight
Cloud DHCP failures are rare, but when they happen (e.g., AWS 'No IP' due to VPC subnet exhaustion), recovery is manual.
The symptom is identical to on-prem — APIPA on Windows, 'No link-local address' on Linux — but the fix is different: add more subnet CIDR.
Rule: monitor subnet utilization in cloud consoles; set alarms at 80% to add CIDR blocks before exhaustion.
Key Takeaway
Cloud DHCP works automatically but offers less control than on-prem.
Subnet exhaustion is the top cloud DHCP failure — plan IP space proactively.
For custom DHCP needs, run your own server on a separate subnet.

Advanced DHCP Troubleshooting: Packet Analysis and Server Logs

When basic commands fail, dig deeper. Wireshark filters like 'bootp' or 'dhcp' show every message. Capture on client and server simultaneously to see what the server sends vs what the client receives. Server logs are critical: ISC DHCP server logs to syslog with entries like 'DHCPDISCOVER from xx:xx:xx:xx:xx:xx via eth0'. Look for 'no free leases' or 'dynamic and static leases conflict'. On Linux, 'dhcpdump' gives real-time view. For Windows, 'netsh dhcp server show scope' shows utilization.

A common advanced issue: the DHCP server's database corrupts, causing it to forget active leases. Rebuilding from backups or restarting with a clean lease file often fixes it. Also check NTP: if server and client clocks drift significantly, lease renewal timers become misaligned. A client might think its lease expired when it hasn't, causing pointless renewals or disconnects.

io/thecodeforge/dhcp_advanced.shBASH
1
2
3
4
5
6
#!/bin/bash
# Advanced DHCP debugging - TheCodeForge
# Capture only DHCP offers and acknowledgements
sudo tcpdump -i eth0 -n -l 'port 67 and (udp[8] & 0x01 != 0)' 2>/dev/null | tee dhcp_capture.txt
# Monitor ISC DHCP server logs for real-time events
sudo tail -f /var/log/syslog | grep -E 'dhcpd|DHCP'
Database Corruption Risk
ISC DHCP server uses a flat-file database (/var/lib/dhcp/dhcpd.leases). If the server crashes during a write, the file can corrupt. Always back up this file and consider using a replicated database setup for critical networks.
Production Insight
A corrupted dhcpd.leases file manifests as 'unable to parse lease' errors in syslog and sudden duplicate IP assignments.
The fix is to restore from backup or, if no backup, delete the file and restart (server will rebuild from active leases).
Rule: schedule regular backups of the DHCP lease database and test restoration procedures.
Key Takeaway
Wireshark + server logs + lease file inspection covers 99% of DHCP issues.
Database corruption is a silent killer — backup your lease file.
For persistent issues, check NTP: clock skew between server and clients breaks lease renewals.

DHCP Failover and Redundancy: Keeping IPs When the Server Goes Down

Single DHCP server = single point of failure. Two common redundancy designs:

  1. Split scopes (80/20 rule): two servers each manage part of the address pool. If one fails, the other still has addresses. Downside: administrative overhead and potential conflicts.
  2. Failover protocol (ISC DHCP or Windows DHCP failover): two servers synchronize lease databases in real-time. If primary fails, secondary takes over seamlessly. Requires careful network design to avoid split-brain scenarios.

In production, failover protocol is preferred for critical subnets. But even with failover, you must test — many teams discover during an outage that the failover relationship wasn't correctly configured or the secondary server was down for maintenance.

Production Insight
Split scopes seem simple but introduce administrative overhead — you need to remember which server owns which range.
Failover protocol introduces dependency on reliable network connectivity between servers.
Rule: implement failover with heartbeat monitoring, and test failover drills quarterly.
Key Takeaway
DHCP failover is not optional for production — plan for server failure.
Split scopes are cheap but administrative; failover protocol is robust but complex.
Always test failover scenarios before they hit you at 3 AM.
Choosing DHCP Redundancy
IfFewer than 500 clients, single subnet
UseOne server with a backup config file is usually sufficient.
IfMultiple subnets, high availability required
UseUse DHCP failover protocol with two servers on separate hardware.
IfDistributed sites, central management
UseCentral servers with relay agents and split scopes per location.

DHCP and Dynamic DNS (DDNS): Automatic Host Registration

In many enterprises, DHCP integration with DNS is a game-changer. When a device gets a lease, the DHCP server can automatically update DNS with the device's hostname and IP. This eliminates manual DNS records for every workstation.

The setup requires: DHCP server must have authority to update DNS, DNS server must accept secure updates, and the zone must be configured for dynamic updates. Common pitfalls: if the DHCP server IP changes, you need to update DNS delegation. Also, when a lease expires or is released, the DHCP server must remove the DNS record — but many deployments forget this, leaving stale DNS entries that cause name resolution errors.

Security note: DDNS updates should be authenticated (TSIG or GSS-TSIG). Unauthenticated updates allow any client to register arbitrary hostnames, enabling DNS poisoning.

DDNS in Practice
In Windows Active Directory, DHCP and DNS integration is built-in. For ISC DHCP + BIND, configure 'ddns-update-style interim' and use TSIG keys.
Production Insight
Stale DNS records from DDNS are a common cause of 'host unreachable' errors after device decommission.
The symptom: clients try to connect to an old IP now assigned to a different device.
Rule: configure DHCP to delete forward and reverse records on lease expiration or release.
Key Takeaway
DDNS automates DNS records but requires careful cleanup on lease expiry.
Authenticate DDNS updates — unauthenticated updates are a security hole.
Stale DNS entries cause silent connectivity issues that are hard to trace.
● Production incidentPOST-MORTEMseverity: high

DHCP Scope Exhaustion Took Down a Branch Office for 4 Hours

Symptom
New devices couldn't obtain an IP address. Existing clients worked fine. The router logs showed 'no free leases'.
Assumption
The team assumed the DHCP server had sufficient addresses for the expected device count.
Root cause
The DHCP scope was configured with a 7-day lease, and the pool size was small. When 50 IoT devices joined, the pool exhausted quickly. The system didn't reclaim expired leases because they were still within the 7-day window.
Fix
Reduced lease time to 1 hour for the IoT subnet. Expanded the scope by adding a secondary subnet with a relay agent. Added alerts at 80% pool utilization.
Key lesson
  • Always calculate the maximum number of concurrent devices and set lease times accordingly.
  • Shorter lease times for high-turnover subnets (guest Wi-Fi, IoT) reduce exhaustion risk.
  • Monitor DHCP pool utilization; set alarms at 70% and 85%.
  • Document subnet growth projections — IoT rollouts often happen faster than planned.
Production debug guideCommon DHCP failures and the exact commands to diagnose each4 entries
Symptom · 01
Device shows 'No IP address' or 'Self-assigned IP' (169.254.x.x)
Fix
Run 'ipconfig /release && ipconfig /renew' (Windows) or 'sudo dhclient -v' (Linux). Check if DHCP server is reachable via ping.
Symptom · 02
IP address obtained but no internet connectivity
Fix
Verify gateway via 'ip route' (Linux) or 'route print' (Windows). Ping the gateway. Check DHCP options: gateway IP might be wrong.
Symptom · 03
Intermittent disconnects every few hours
Fix
Check lease time and renewal behaviour. Use 'dhcpdump' or Wireshark to capture DHCP RENEW packets. Look for NAKs from server.
Symptom · 04
Some devices get IPs, others don't, on same subnet
Fix
Check DHCP server request logs. Look for duplicate client ID (MAC collisions). Verify relay agent configuration if using multiple VLANS.
★ DHCP Quick Debug Cheat SheetUse these commands when you need to fix DHCP fast — no theory, just action.
No DHCP lease on Linux
Immediate action
Check if dhclient is running
Commands
ps aux | grep dhclient
sudo dhclient -v eth0
Fix now
Restart networking: sudo systemctl restart networking
Windows can't get IP+
Immediate action
Release and renew
Commands
ipconfig /release
ipconfig /renew
Fix now
Reset TCP/IP stack: netsh int ip reset
DHCP server not responding+
Immediate action
Check if server is up and listening
Commands
sudo netstat -tulpn | grep :67
sudo tcpdump -i any port 67 or port 68
Fix now
Restart DHCP service: sudo systemctl restart isc-dhcp-server
Duplicate IP address detected+
Immediate action
Find the rogue device
Commands
arp -a | grep <IP>
sudo dhcpdump (watch for offer/ack)
Fix now
Remove lease from server or reboot the offending device
DHCP vs Related Protocols
ConceptUse CaseExample
DHCP (IPv4)Automatic IP assignment for most devicesHome router assigns 192.168.1.50 to laptop
Static IPFixed address needed for servers, printersWeb server at 192.168.1.10 configured manually
DHCP RelayCross-subnet DHCPRelay agent forwards client broadcast to server on different subnet
DHCP OptionsConfiguration deliveryOption 6 = DNS server, Option 3 = Default Gateway
SLAAC (IPv6)Stateless address auto-configurationClient generates IP from router advertisement prefix
DHCPv6Stateful/stateless IPv6 address and option assignmentServer assigns 2001:db8::100 and DNS server
Cloud DHCP (AWS/Azure/GCP)Automatic assignment in virtual networksAWS VPC assigns 10.0.1.5 to EC2 instance

Key takeaways

1
You now understand what DHCP is and why it exists
the protocol that automates IP assignment.
2
DORA is the four-step handshake that guarantees a unique IP lease; failure at any step means no connectivity.
3
DHCP options deliver critical network config (gateway, DNS) beyond the IP
one wrong value can break a subnet.
4
Scope exhaustion is the #1 production failure
plan lease times and pool sizes based on device mobility.
5
DHCP has no security
use snooping, port security, and 802.1X to protect against rogue servers and starvation.
6
Cloud DHCP is simple but limited; monitor subnet utilization to avoid silent exhaustion.
7
Troubleshoot systematically
packet capture → server logs → relay config → lease file.
8
DDNS automates DNS records but requires cleanup on lease expiry to avoid stale entries.
9
IPv6 introduces SLAAC and DHCPv6
understand the differences for dual-stack networks.
10
DHCP failover is essential for production; test your redundancy before 3 AM hits.

Common mistakes to avoid

7 patterns
×

Memorising syntax before understanding the concept

Symptom
You can recite DHCP messages but can't troubleshoot a real failure.
Fix
Practice packet captures and simulate failures in a lab.
×

Skipping practice and only reading theory

Symptom
You know DORA by heart but can't run dhclient or interpret logs.
Fix
Set up a virtual network with VirtualBox and test DHCP manually.
×

Using overly long lease times for dynamic environments

Symptom
Stale leases block new devices; IP pool exhausts even though many devices are offline.
Fix
Set lease times aligned to device mobility: 1 hour for guest Wi-Fi, 8 hours for workstations, weeks for servers.
×

Assuming DHCP servers are always on the same subnet

Symptom
Clients never receive DHCP offers when server is on a different VLAN and no relay agent is configured.
Fix
Configure 'ip helper-address' on the client VLAN interface or run a DHCP relay service.
×

Ignoring DHCP option configuration

Symptom
Clients get IP but cannot resolve DNS or reach the internet because wrong gateway/DNS was pushed.
Fix
Audit DHCP options regularly; test with a client that reports the options it received via 'ipconfig /all' or 'dhclient -v'.
×

Relying on static IPs to avoid DHCP

Symptom
IP conflicts when multiple devices use the same static IP; manual updates when network changes.
Fix
Use DHCP reservations for devices that need fixed IPs; keep static IPs only for infrastructure that can't support DHCP.
×

Forgetting to configure DDNS cleanup on lease expiry

Symptom
Stale DNS records point to old IPs, causing connection failures to recently decommissioned devices.
Fix
Enable 'delete on expiry' in DHCP-DDNS settings and audit DNS zones periodically.
INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01SENIOR
Explain the four steps of DHCP and what happens if the DHCP server is do...
Q02SENIOR
How does a DHCP relay agent work and why is it necessary?
Q03SENIOR
What security vulnerabilities exist in DHCP and how do you mitigate them...
Q04SENIOR
How would you design a DHCP infrastructure for a multi-site enterprise w...
Q05SENIOR
Explain the difference between split scope and failover protocol for DHC...
Q06SENIOR
How does Dynamic DNS (DDNS) interact with DHCP, and what can go wrong?
Q01 of 06SENIOR

Explain the four steps of DHCP and what happens if the DHCP server is down.

ANSWER
DHCP uses DORA: Discover, Offer, Request, Acknowledge. When a client boots, it sends a broadcast Discover. The server responds with an Offer containing an IP and options. The client then sends a Request, and the server finalizes with an Acknowledge. If the server is down, the client will not receive an Offer. After multiple retries (typically 30-60 seconds), the client gives up and assigns itself an Automatic Private IP Address (APIPA) in the 169.254.x.x range. The client will continue to retry periodically (e.g., every 5 minutes) to contact the DHCP server. In enterprise environments, having redundant DHCP servers or using multiple relay agents can mitigate this single point of failure.
FAQ · 10 QUESTIONS

Frequently Asked Questions

01
What is DHCP in simple terms?
02
What does DORA stand for in DHCP?
03
Why do I get a 169.254.x.x IP address when DHCP fails?
04
What is a DHCP lease and how long should it be?
05
Can DHCP work across different subnets?
06
Is DHCP secure?
07
What is the difference between DHCPv4 and DHCPv6?
08
How do I check DHCP lease utilization on a Cisco router?
09
What is the 80/20 rule in DHCP split scopes?
10
How do I prevent rogue DHCP servers on my network?
🔥

That's Computer Networks. Mark it forged?

9 min read · try the examples if you haven't

Previous
ARP — Address Resolution Protocol
18 / 22 · Computer Networks
Next
What Is a Checksum Error: Data Integrity Verification Failures Explained