Testing DHCP on tagged VLANs from a Raspberry Pi

2026-11-22来源 dev.toEnglish

A trunk port can look fine and still hand the wrong VLAN a DHCP lease. The usual check is to re-cable a laptop and add a temporary VLAN interface. A Raspberry Pi on the bench is a better test client: small, wired, and easy to leave on the switch port while you watch the offer.

This post uses PathProbe, a command-line DHCP and VLAN tester we build, on Raspberry Pi OS 64-bit. The Free tier covers everything here except the optional QinQ example at the end. Use it only on a network you own or are authorized to test. pathprobe dhcp run will not start without --authorized (or --i-am-authorized).

If you want short demos and explainers, subscribe to Been There, Built That on YouTube: https://www.youtube.com/@BeenThere.BuiltThat

What you are proving

First, an untagged DHCP client on the port should get a lease from the VLAN you expect for untagged traffic. Second, a client that sends an 802.1Q tag for VLAN 100 (or whichever ID you are allowed to test) should get a lease from that VLAN, not the untagged one. If the first test works and the second fails, the port, the trunk, or the DHCP helper is not doing what the switch config claims.

Set up the Pi

Install the current arm64 package from getpathprobe.com. The live download at the time of writing is PathProbe 1.2.1:

sudo apt install ./pathprobe_1.2.1_arm64.deb pathprobe interfaces 

Plug the Pi into the switch port under test. On a trunk, an untagged client and a tagged client should see different broadcast domains. Use a port you are allowed to test, and do not try to exhaust someone else's DHCP pool.

Untagged first

Start with one client, a short run, and a capture you can open later in Wireshark:

sudo pathprobe dhcp run --iface eth0 --count 1 --family v4 \ --duration 30s --capture lab-untagged.pcapng --authorized 

You should see a bind, an address in the range you expect (the examples in our docs use 192.0.2.x), and a pcapng in the current directory. If this already fails, fix the access VLAN, the helper address, or the pool before you start tagging.

Then send a tag

On Free, PathProbe can send a single 802.1Q tag. --vlan-seed is the VLAN ID. Change 100 to the VLAN you are actually allowed to test. The MAC below is a documentation address, not a real adapter:

sudo pathprobe dhcp run --iface eth0 --count 1 --family v4 \ --vlan single --vlan-seed 100 --duration 30s \ --mac-seed 02:00:00:00:00:30 \ --capture lab-vlan100.pcapng --authorized 

If the untagged test worked and this one does not, the port is not passing VLAN 100 the way you think it is. That is the useful result. In the two pcapng files, look for a DISCOVER with a VLAN tag, an OFFER from the right pool, and an ACK. PathProbe writes the capture; you read it in Wireshark or tcpdump.

You can also start with five clients, which is the Free-tier limit:

sudo pathprobe dhcp run --iface eth0 --count 5 --vlan single \ --vlan-seed 100 --authorized 

Optional: stacked tags

QinQ (--vlan qinq) is a Pro feature. On Free the command tells you that and exits:

sudo pathprobe dhcp run --iface eth0 --count 1 --family v4 \ --vlan qinq --svlan-seed 200 --vlan-seed 100 --duration 30s --authorized 

--svlan-seed is the outer tag; --vlan-seed is the inner tag. The switch has to be set up for the stacked-tag mode you are testing.

A few rules that save pain

Only test networks you own or are allowed to test, and do not publish screenshots or captures that show real IPs, MACs, hostnames, or usernames. PathProbe 1.2.1 can write a scrubbed copy of a run log with pathprobe log share if you need to ask for help. Windows works too (it needs Npcap). There is no macOS build yet, and PathProbe is command-line only.

The Free download, checksums, and the current feature split are at https://getpathprobe.com. Free never expires (up to 5 clients and a single 802.1Q tag). Pro is $9.99 one-time. There is also a Lab Bundle with JackedIN for $24.99: https://getpathprobe.com/bundle/. Students, teachers, and CTF teams can email service@getpathprobe.com for a 40% off code. If a tagged offer ever surprises you, the capture is the evidence, not the switch port LED.

Disclosure: we build PathProbe. The Free tier covers the untagged and single-tag examples in this post.

原文:https://www.a8q9.cn/en/article/testing-dhcp-on-tagged-vlans-from-a-raspberry-pi-d3b0cc.html

相关文章