How to Test a DHCP Server from Linux or Windows
A DHCP server can look fine in its own UI and still fail the only test that matters: a client on the right segment, or the right VLAN, getting a lease with the options you intended. This guide covers practical ways to run that test from Linux or Windows, starting with tools you may already have.
Only test a network you own or are authorized to test. Simulating many clients can exhaust a server's address pool.
What a passing test actually checks
"The PC got an address" is a start, not the whole story. A useful DHCP test answers all of these:
- The client completes the DHCPv4 exchange (Discover, Offer, Request, ACK — often remembered as DORA).
- The offered address is in the scope you meant, not a leftover server or a guest network.
- The mask, default gateway, DNS, and lease time are the values you configured.
- The same thing still works on the VLAN or relay path the production clients will use.
On IPv6 the message names change, but the idea is the same: confirm the server answers, and confirm the options. Examples below use 192.0.2.0/24, names such as eth0 and "Ethernet 2", and locally administered MACs such as 02:00:00:00:00:a1. Replace them with the names on your computer.
First checks you can run with one real client
If you already have a laptop or VM on the same layer-2 segment as the server, start there.
On Windows, in Command Prompt or PowerShell:
ipconfig /release ipconfig /renew ipconfig /all
Look at IPv4 Address, Subnet Mask, Default Gateway, DHCP Server, and DNS Servers. A 169.254.x.x address (APIPA) usually means the client broadcast a Discover and never got a usable Offer.
On Linux, a temporary dhclient test on eth0 can disrupt the current address, so prefer a spare interface or a lab box:
sudo dhclient -v eth0 ip -4 addr show dev eth0
Then check the server log or lease list (ISC dhcpd, Kea, Windows DHCP, or the appliance UI). You should see a new entry for the test client.
These checks are honest, and limited. You get one client per NIC. A different VLAN often means recabling, retagging a port, or building a VM with a tagged interface. A small pool needs more than one client to test.
Watch the packets: tcpdump, Wireshark, dhcpdump
When a renew fails, the next question is whether the Discover left the client, whether an Offer came back, and whether a relay or a second DHCP server is involved.
On Linux, a typical capture on the client (or on a span/mirror port) looks like this:
sudo tcpdump -i eth0 -n -w dhcp-test.pcapng udp port 67 or udp port 68
Open the file in Wireshark and filter on bootp or dhcp. You want to see Discover and Offer, then Request and ACK, and you want to inspect option 3 (router), option 6 (DNS), option 51 (lease time), and the server identifier. If you are testing a relay, option 82 and the GIADDR field are the first things to look at.
dhcpdump is a concise alternative if you already have it; dhcping can send a request toward a named server. Both help on a lab NIC. Neither one replaces several concurrent clients, or an 802.1Q tag, without extra setup.
On Windows, Wireshark with Npcap can capture the same conversation. Start the capture before you run ipconfig /renew.
A faster lab check: simulate several clients from one terminal
PathProbe is a command-line network test tool for Linux, Windows, and Raspberry Pi arm64. It has no graphical interface. The free tier, which does not expire, can simulate up to five DHCPv4 or DHCPv6 clients, optionally with a single 802.1Q tag, and can write a pcapng file you later open in Wireshark.
On Debian or Ubuntu, install the .deb. On other Linux systems, unpack the .tar.gz and, if you want to avoid sudo on every run, give the binary the two capabilities it needs, then confirm the install:
pathprobe --version pathprobe interfaces
On Windows 10 or 11, install Npcap, then run PathProbe from an Administrator Command Prompt or PowerShell. Quote interface names that contain spaces. --iface also accepts a MAC address and ignores letter case.
dhcp run will not start unless you add --i-am-authorized (or the shorter --authorized). That flag is how you confirm you may test the network. You also have to pass --count.
A short five-client run on Linux, 30 seconds, then a clean release:
sudo pathprobe dhcp run --iface eth0 --count 5 --duration 30s --i-am-authorized
The same idea on Windows:
C:\> pathprobe dhcp run --iface "Ethernet 2" --count 5 --duration 30s --i-am-authorized
A real three-client run against a server on the same segment looks like this (addresses replaced with documentation values):
interface eth0 ifindex=2 DHCP session started on eth0 tier free, up to 5 clients; control socket /run/pathprobe/control.sock Ctrl-C or dhcp stop releases leases and exits. --duration stops on its own. client 3 DHCPv4 bound 192.0.2.101 client 1 DHCPv4 bound 192.0.2.100 client 2 DHCPv4 bound 192.0.2.102 bound v4=3 v6=0 tx=6 txerr=0 rx=6 arp=0 ndp=0 icmp=0 dropped=0 client 3 DHCPv4 released 192.0.2.101 client 1 DHCPv4 released 192.0.2.100 client 2 DHCPv4 released 192.0.2.102 stopped
If you want to inspect a live session from a second terminal, use the same privileges as the run:
sudo pathprobe dhcp status sudo pathprobe dhcp stop
dhcp status prints each client, its MAC, the bound address, and the VLAN mode. With no session running it prints no active PathProbe session and exits 1.
To keep a capture for Wireshark (PathProbe only writes the file; it does not analyze it):
sudo pathprobe dhcp run --iface eth0 --count 3 --duration 20s --capture lab.pcapng --capture-filter "udp port 67 or udp port 68" --authorized
On Windows, pass a path such as --capture C:\Temp\lab.pcapng.
Testing a VLAN without recabling the laptop
Free includes none or a single 802.1Q tag. To ask for VLAN 100 on each simulated client:
sudo pathprobe dhcp run --iface eth0 --count 5 --vlan single --vlan-seed 100 --authorized
C:\> pathprobe dhcp run --iface "Ethernet 2" --count 5 --vlan single --vlan-seed 100 --authorized
If those clients bind addresses from the VLAN 100 scope, the server, the trunk, and the relay are doing their jobs. If they get nothing, or they get the untagged LAN scope, the tag is not landing where you think it is — which is exactly the kind of mistake a single untagged laptop will not show you.
QinQ, more than five clients, saved profiles, and scheduled runs are Pro features. You do not need them for a first lab check. The free tier is how you try PathProbe; there is no separate trial.
How to read a failure
- No Discover on the wire. Wrong interface, NIC down, or a local policy blocking DHCP. Confirm the name with
pathprobe interfacesorpathprobe link --iface eth0. - Discover goes out, no Offer comes back. The server is off-segment, a relay or VLAN is wrong, or another device is absorbing broadcasts. Capture both sides if you can.
- Offer arrives, Request or ACK does not. Check the offered address and the server identifier. Two DHCP servers on one VLAN often explain a messy trace.
- A lease arrives, but the gateway or DNS is wrong. The handshake worked; the scope options did not.
- 169.254.x.x on a Windows NIC. Treat it as "no usable Offer," then use a capture or a second test client to separate a client problem from a VLAN, relay, or server problem.
A short lab checklist
- Confirm you are allowed to test this network.
- Identify the interface with
pathprobe interfaces(orip link/Get-NetAdapter). - Run a small, time-bounded test (
--count 3or--count 5,--duration 30s). - Compare the bound addresses and options with the scope you configured.
- Keep a pcapng and open it in Wireshark if anything looks off.
- If the production path is tagged, repeat the run with
--vlan singleand the VLAN ID you expect. - Stop or let
--durationexpire so the test leases are released.
Try it yourself
PathProbe 1.2.1 is free to download for Linux, Windows (Npcap required), and Raspberry Pi arm64. The free tier never expires: core commands, up to five DHCP clients, a single 802.1Q tag, pcapng capture, and a run log.
- Site and downloads: https://getpathprobe.com
- Release files: https://github.com/getpathprobe/pathprobe-releases/releases/latest
Pro is $9.99 USD, one-time, if you later need up to 1,000 clients, QinQ, saved profiles, live JSON events, an MCP server, or scheduled runs with alerts. One license activates one computer. Students, classes, and CTF teams can email service@getpathprobe.com about 40% off.