Virtualization · Virtual Networking
VLAN Trunking
Cheat sheet · https://pcornel.dk/topic.php?topic=3525
Answer
VLAN Trunking allows multiple VLANs to traverse a virtual or physical link by carrying tagged frames and, depending on design, an optional untagged/native VLAN.
Remember
- A trunk is an allowed-VLAN policy, not simply “tagging enabled.”
- Both ends must agree on which VLANs are permitted and how untagged/native traffic is handled.
- A guest using a trunk must understand and generate the expected VLAN tags unless the hypervisor performs the mapping.
- Trunk misconfiguration can selectively break only some VLANs while link state remains healthy.
First checks
bridge vlan show dev <tap>— trunk VLANs on a portSet-VMNetworkAdapterVlan -VMName <vm> -Trunk -AllowedVlanIdList 10-20 -NativeVlanId 0— Hyper-V trunk to guesttcpdump -e -i <nic> vlan— see tags
Verify in this order
multiple VLAN tags → trunk port → switch
Where it usually breaks
First mismatch in guest NIC → virtual switch/bridge → VLAN/port group/security policy → physical uplink → routed path → peer/workload; preserve identity/native error/pre-state before mutation.
Virtual Networking → VLAN Trunking reference map
| Boundary | Meaning | Evidence limit |
|---|---|---|
| Allowed VLANs | Explicit VLAN set | Policy boundary |
| Tagged VLAN | 802.1Q frame | Preserved across trunk |
| Native/untagged | Design-specific | Must match peer |
| Guest trunk | Guest handles tags | Driver/OS dependency |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3525