Introduction
When a client fails to obtain an IP address from your DHCP server, the troubleshooting surface is deceptively large: Is the server reachable? Is it responding? Is the response malformed? Are rogue DHCP servers interfering? Three specialized command-line tools — dhcping, dhcpdump, and dhcp-probe — each address a different layer of the DHCP diagnostic stack, from active probing to passive capture to network-wide discovery.
This guide compares these three diagnostic tools, providing practical workflows for resolving common DHCP issues in self-hosted environments.
Feature Comparison
| Feature | dhcping | dhcpdump | dhcp-probe |
|---|---|---|---|
| Approach | Active: sends DHCP requests | Passive: captures and decodes | Active: discovers DHCP servers |
| Operation | Sends DHCPREQUEST/INFORM | Sniffs DHCP traffic on interface | Broadcasts DHCPDISCOVER, collects offers |
| Requires Privileges | No (can use raw sockets) | Yes (requires packet capture) | Yes (raw sockets, broadcast) |
| Output Format | Exit code + human-readable text | Decoded DHCP fields with timestamps | List of responding DHCP servers |
| Discover Rogue Servers | No (targets specific server) | Partially (can see all responses) | Yes (primary purpose) |
| Validate Server Responses | Yes (checks response content) | Yes (decode and inspect manually) | Limited (presence only) |
| Protocol Support | DHCPv4 only | DHCPv4 + DHCPv6 | DHCPv4 only |
| Typical Use Case | Monitoring: “Is my DHCP server alive?” | Debugging: “What is the server actually sending?” | Auditing: “Are there unauthorized DHCP servers?” |
dhcping — Active DHCP Server Health Check
dhcping sends a real DHCP request to a specific server and validates the response. It is the DHCP equivalent of a ping or HTTP health check — ideal for monitoring scripts, Nagios/Icinga plugins, and automated alerting.
Installation
| |
Usage Examples
| |
Interpreting Exit Codes
| Exit Code | Meaning |
|---|---|
| 0 | Success: DHCP server responded with a valid offer/ACK |
| 1 | No response: Server timed out or is unreachable |
| 2 | Invalid response: Server replied but response was malformed |
| 3 | Error: Local configuration or permissions problem |
dhcpdump — Passive DHCP Traffic Decoder
dhcpdump captures DHCP packets from the wire and decodes every field in a human-readable format. It leverages libpcap (the same library tcpdump uses) and displays the full contents of DHCP DISCOVER, OFFER, REQUEST, ACK, NAK, and other message types. Think of it as tcpdump specialized for DHCP — you see the raw conversation between client and server.
Installation
| |
Usage Examples
| |
Sample Output Analysis
A typical dhcpdump output shows the full DHCP conversation structure:
| |
This level of detail lets you verify that the correct DNS servers are being distributed, lease times match your policy, and no unexpected options are present.
dhcp-probe — Rogue DHCP Server Discovery
dhcp-probe broadcasts DHCPDISCOVER packets and collects responses from ALL DHCP servers on the network segment — not just the one you expect. It is the go-to tool for detecting unauthorized (rogue) DHCP servers that could be handing out incorrect IP addresses or intercepting traffic.
Installation
| |
Usage Examples
| |
Sample Output
| |
Diagnostic Workflow
Here is a systematic approach to DHCP troubleshooting combining all three tools:
| |
Why Self-Host Your DHCP Diagnostics
DHCP failures are network-stopping events — when clients cannot obtain IP addresses, everything from web browsing to SSH access fails. Cloud-based monitoring tools cannot help during a DHCP outage because they are unreachable. Having these diagnostic tools installed locally means you can troubleshoot even when the network is down.
For managing the DHCP server infrastructure itself, see our Kea DHCP server management guide. If DNS resolution is also affected, our DNS debugging tools comparison covers complementary DNS-level diagnostics. For IP address allocation tracking across your infrastructure, our IPAM comparison guide helps you maintain accurate records of address utilization.
Together, these tools provide complete DHCP visibility: server discovery (dhcp-probe), health monitoring (dhcping), and protocol-level debugging (dhcpdump).
FAQ
What is the difference between dhcping and simply pinging the DHCP server?
Pinging a DHCP server with ICMP only confirms that the host is alive at the IP layer — it does not verify that the DHCP service is running and responding correctly. The DHCP daemon could be crashed while the kernel still responds to pings. dhcping sends actual DHCP protocol messages and validates the response structure, providing application-layer health verification that a simple ICMP ping cannot.
Can dhcpdump capture DHCPv6 traffic?
Yes, most modern builds of dhcpdump support DHCPv6 capture. Use dhcpdump -i eth0 and it will automatically decode both DHCPv4 and DHCPv6 packets. DHCPv6 uses different message types (SOLICIT, ADVERTISE, REQUEST, REPLY instead of DISCOVER, OFFER, REQUEST, ACK) and uses multicast addresses (ff02::1:2) instead of IPv4 broadcast, but dhcpdump handles both transparently.
How do I run dhcpdump as a non-root user?
DHCP traffic uses privileged ports and raw sockets, so dhcpdump normally requires root. However, you can grant a specific user packet capture capabilities: sudo setcap cap_net_raw,cap_net_admin=eip /usr/sbin/dhcpdump. Alternatively, add your user to the pcap group if your distribution creates one. For systemd-based monitoring, create a service unit that runs dhcpdump as a dedicated unprivileged user with AmbientCapabilities=CAP_NET_RAW CAP_NET_ADMIN.
What should I do if dhcp-probe finds a rogue DHCP server?
First, identify the physical switch port by checking the MAC address against your switch’s MAC address table (show mac address-table on Cisco, bridge fdb show on Linux bridges). Disable the port immediately to contain the rogue server. Then investigate: is it a misconfigured consumer router someone plugged in, or a deliberate attack? For persistent monitoring, consider deploying dhcp-probe as a cron job or systemd timer that alerts on unexpected DHCP servers.
Why would I use all three tools instead of just Wireshark?
Wireshark is a full-featured GUI protocol analyzer, but it requires a graphical environment, is not scriptable for monitoring, and cannot actively probe DHCP servers. dhcping integrates with monitoring systems (Nagios, Icinga, Prometheus exporters) via exit codes. dhcpdump provides targeted DHCP-only output without the noise of filtering through full packet captures. dhcp-probe performs active discovery that passive capture alone cannot. For headless servers and automated monitoring, these three CLI tools are more practical than a GUI analyzer.
💰 想测试你的市场判断力?我用 Polymarket 做预测市场交易——这是全球最大的预测市场平台,从大选结果到 科技政策监管时间线,什么都可以押注。和赌博不同,这是真正的信息市场:你懂的信息越多,胜率越高。我靠预测 科技行业的发展趋势已经赚了不少。用我的邀请链接注册:Polymarket.com