Pcornel
Virtualization · Virtual Networking

VLAN Trunking

Cheat sheet · https://pcornel.dk/topic.php?topic=3525

Back to the Topic

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 port
  • Set-VMNetworkAdapterVlan -VMName <vm> -Trunk -AllowedVlanIdList 10-20 -NativeVlanId 0 — Hyper-V trunk to guest
  • tcpdump -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

BoundaryMeaningEvidence limit
Allowed VLANsExplicit VLAN setPolicy boundary
Tagged VLAN802.1Q framePreserved across trunk
Native/untaggedDesign-specificMust match peer
Guest trunkGuest handles tagsDriver/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

Confirmation

Confirm action

Continue?