Networking guides, explanations and reader checklists on whilenetworking.com

Wireshark Forensics: Decode DHCP Offer/DNAccept Packets to Resolve Scope Exhaustion and Duplicate IP Issues

In dynamic network environments, Dynamic Host Configuration Protocol (DHCP) is the backbone of automated IP address management. However, when a scope runs…

In dynamic network environments, Dynamic Host Configuration Protocol (DHCP) is the backbone of automated IP address management. However, when a scope runs out of addresses or duplicate IPs appear, the root cause is often hidden in the handshake between the client and the server. While basic ping tests confirm connectivity, they do not reveal why an IP conflict exists or if the lease pool is genuinely exhausted. This guide demonstrates how to use Wireshark to dissect DHCP Offer (Message Type 2) and DHCP ACK (Message Type 5) packets. By analyzing these specific frames, IT professionals can pinpoint scope exhaustion, rogue servers, or misconfigured relay agents.

Understanding the DHCP Handshake in Forensics

To troubleshoot effectively, one must understand the four-step DORA process: Discover, Offer, Request, and Acknowledge. The critical data for diagnosis lies in the transition from the Offer to the Acknowledge.

When a client broadcasts a DHCPDISCOVER packet (Message Type 1), it contains no IP address but includes its MAC address and a Transaction ID. A valid DHCP server responds with a DHCPOFFER packet. This packet contains:
* Transaction ID: Must match the client’s request to ensure the reply belongs to this specific inquiry.
* Server Identifier: The IP address of the server making the offer.
* IP Address Lease Time: How long the client can use the assigned IP.
* Subnet Mask and Gateway: Configuration parameters embedded in the option fields.

If the network is functioning correctly, the client sends a DHCPREQUEST (Message Type 3) to accept the offer, and the server replies with a DHCPACK (Message Type 5). However, issues arise when no Offer is received (scope exhaustion), or when multiple distinct Servers appear in the Offer packets (rogue servers), or when the IP address field in the ACK differs from the one requested.

Prerequisites and Lab Setup

Before running forensic analysis, ensure you have a safe test environment. Do not run these commands on a production network without prior authorization, as capturing live traffic can impact performance on high-traffic links.

Prerequisites:
* Operating System: Windows 10/11, Linux (Ubuntu/CentOS), or macOS with Wireshark installed.
* Network Access: A machine connected to the same VLAN as the DHCP server and clients.
* Filters: Familiarity with BPF (Berkeley Packet Filter) syntax for Wireshark.

Lab Scenario:
Imagine a corporate branch office using 192.168.10.0/24 subnet. The legitimate DHCP server is at 192.168.10.1. Recently, users report “IP Address in Use” errors. Your task is to determine if the pool is empty or if an unauthorized device is handing out IPs.

Step-by-Step Analysis: Capturing and Filtering Traffic

The first step is capturing the traffic. Open Wireshark and select the interface connected to your network switch (e.g., eth0 or Wi-Fi). Start a new capture, then trigger the event you want to analyze. In our scenario, connect a new laptop to the network and wait for it to obtain an IP address, or force an IP conflict by assigning a static IP that overlaps with the dynamic pool.

Stop the capture immediately after the client obtains an address or encounters an error. Open the Filter bar at the top and apply the following filter to isolate DHCP traffic:

bootp or dhcp

This generic filter captures both legacy BOOTP and modern DHCP packets. For more specific analysis, narrow it down to the handshake phases:

(dhcp && (dhcp.msgtype == 2) || dhcp.msgtype == 5)

Note: In Wireshark’s dissector display, msgtype values may vary slightly depending on the version and capture format. Often, you can simply expand the “DHCP” protocol tree in the packet details pane to see the Message Type value.

Decoding Scope Exhaustion via Offer Packets

Scope exhaustion occurs when the DHCP server has no free addresses left in its configured pool. In a Wireshark capture of this scenario, you will notice a distinct pattern:

  1. No DHCPOFFER: The client sends DHCPDISCOVER, but the legitimate server (192.168.10.1) sends no response.
  2. APIPA Assignment: Eventually, the client may assign itself an Automatic Private IP Addressing (APIPA) address in the 169.254.0.0/16 range. If you see a DHCPNAK or silence followed by APIPA traffic, the scope is likely exhausted.
  3. Relay Agent Issues: If your network uses DHCP Relays to serve multiple subnets, verify that the Relay Agent Information Option (Option 82) is being processed correctly. If the relay drops packets due to pool exhaustion on the upstream server, no Offer will appear in the capture for clients behind that relay.

Verification Step:
Check the client’s network interface configuration after the event. If the IP starts with 169.254, the DHCP server failed to respond. In Wireshark, look for the final packet from the client; if it is a broadcast DHCPREQUEST with no subsequent unicast or broadcast response from the server, the scope is depleted.

Identifying Duplicate IPs and Rogue Servers

Duplicate IP issues are often caused by rogue DHCP servers or misconfigured static assignments colliding with dynamic pools. When analyzing the DHCPOFFER packet in Wireshark:

  • Server Identifier Check: Expand the “DHCP” section in the packet details. Look at the Server Identifier field. If you see multiple different IP addresses responding to a single DHCPDISCOVER from the same client, you have a rogue server or a misconfigured relay broadcasting offers incorrectly.
  • IP Address Field Mismatch: In a DHCPOFFER or DHCPACK, compare the Requested IP Address (Option 50) with the IPAddress offered (Option 1). If they differ significantly, it might indicate a server trying to force an address outside its scope, potentially causing conflicts.

Illustrative Output Analysis:

Frame 42: [DHCP Offer] from 192.168.10.99 (Rogue?) to broadcast
    DHCP Message Type: Offer (2)
    Transaction ID: 0x1a2b3c4d
    Server Identifier: 192.168.10.99  <-- Unusual if expected server is .1
    IP Address: 192.168.10.50

If the legitimate server is 192.168.10.1 and you see offers from .99, that device is likely an unauthorized DHCP server, or a misconfigured L3 switch acting as a router with DHCP services enabled.

Common Mistakes and Fixes

When troubleshooting with Wireshark, avoid these common pitfalls:

  • Ignoring VLAN Context: DHCP broadcasts are limited by VLANs unless relayed. If you capture on Port A but the server is in VLAN 10 and the client in VLAN 20 without a relay, you will see no offers. Ensure your filter accounts for vlan tags if necessary (ethertype 0x800 && dhcp).
  • Assuming Silence Means Exhaustion: Sometimes, network congestion or firewall rules blocking UDP port 67/68 cause dropped packets. Check for DHCPNAK messages; their absence doesn’t guarantee exhaustion, only that the server isn’t replying.
  • Static IP Conflicts: A user manually setting an IP like 192.168.10.50 while the DHCP pool ends at .50 will cause a conflict. Wireshark won’t show this as a protocol error, but you will see two hosts claiming the same MAC-to-IP mapping or ARP spoofing alerts in your logs.

Fixes:
1. Expand Scope: Log into the legitimate DHCP server and increase the upper limit of the address pool.
2. Remove Rogue Server: Disable DHCP services on unauthorized routers, switches, or APs.
3. Correct Relay Configuration: Ensure ip helper-address commands point to the correct DHCP server IP in your router configuration.

Student Practice Task and Industry Application

Student Practice Task:
Set up a virtual lab using Cisco Packet Tracer or GNS3. Create two VLANs (VLAN 10 and VLAN 20). Configure a DHCP server on VLAN 10 to serve only VLAN 10. Attempt to assign an IP to a device in VLAN 20 without configuring a DHCP relay on the inter-VLAN router. Observe the Wireshark capture: you should see DHCPDISCOVER broadcasts but no DHCPOFFER. Now, configure the relay correctly and repeat the test. Finally, intentionally add a second virtual machine acting as a rogue DHCP server and observe the multiple offers in Wireshark.

Industry Application:
In an enterprise environment, network engineers use this technique during migration projects or after hardware failures. When a legacy server crashes but its IP remains active in the pool, or when a new switch is introduced with default settings, these tools prevent widespread connectivity issues. By decoding the Offer/Ack packets, teams can automate scripts to detect rogue DHCP servers and alert security operations centers immediately.

Conclusion

Resolving scope exhaustion and duplicate IP issues requires more than just checking a status LED; it demands deep packet inspection. Wireshark allows you to visualize the exact moment a DHCP transaction fails or goes astray. By examining the Server Identifier, Transaction ID, and specific option fields in DHCPOFFER and DHCPACK packets, administrators can distinguish between a full address pool, a rogue server, or a configuration mismatch. Always verify findings against authoritative documentation for your specific DHCP server software (e.g., Cisco IOS, Microsoft SC,ISC DHCPd), as version differences may alter field representations. This forensic approach ensures network stability and security in complex multi-subnet environments.

Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.