Skip to content

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 ​

NodeImageCPUs / memoryAddressesRole
r1debian-131 / 1GiBmgmt 10.118.0.11Routes between VLAN 10 and 20
swdebian-131 / 1GiBmgmt 10.118.0.12VLAN-aware bridge
h10debian-131 / 1GiBmgmt 10.118.0.13; lan 192.168.10.10/24Host in VLAN 10
h20debian-131 / 1GiBmgmt 10.118.0.14; lan 192.168.20.10/24Host in VLAN 20

Before you start ​

bash
vz image pull disk debian-13

Run it ​

bash
cd examples/18-vlan-trunk
vz validate
vz up
vz node ls
ssh lab@10.118.0.11        # password: lab

Try 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