18 VLANs and a trunk
Router on a stick: a Linux bridge with access ports for VLANs 10 and 20, and one tagged trunk to the router.
What you practice
- 802.1Q VLAN interfaces in netplan
- A VLAN-aware Linux bridge with
bridge vlan - Seeing tags on the wire with
tcpdump -e
Topology
| Node | Image | CPUs / memory | Addresses | Role |
|---|---|---|---|---|
r1 | debian-13 | 1 / 1GiB | mgmt 10.118.0.11 | Routes between VLAN 10 and 20 |
sw | debian-13 | 1 / 1GiB | mgmt 10.118.0.12 | VLAN-aware bridge |
h10 | debian-13 | 1 / 1GiB | mgmt 10.118.0.13; lan 192.168.10.10/24 | Host in VLAN 10 |
h20 | debian-13 | 1 / 1GiB | mgmt 10.118.0.14; lan 192.168.20.10/24 | Host in VLAN 20 |
Before you start
bash
vz image pull disk debian-13Run it
bash
cd examples/18-vlan-trunk
vz validate
vz up
vz node ls
ssh lab@10.118.0.11 # password: labTry it
bash
ssh lab@10.118.0.13 'ping -c 2 192.168.20.10' # VLAN 10 -> 20 through r1
ssh lab@10.118.0.12 'bridge vlan show'
ssh lab@10.118.0.11 'sudo tcpdump -eni trunk -c 4 icmp' # look for "vlan 10" and "vlan 20"Notes
Every node also has a mgmt NIC on a NAT switch: out-of-band access from the Mac and package downloads. The exercise traffic stays on the links.
Clean up
bash
vz down
vz destroy --yes # deletes the overlays and state of this lab