VLAN
Cheat sheet · https://pcornel.dk/topic.php?topic=3705
Answer
Hyper-V can enforce VLAN behavior at the virtual port, while the external physical uplink and upstream switch must agree on tagging/native/trunk expectations. A configured VLAN ID is not packet-path proof.
Remember
- VLAN configured ≠ tag observed on wire.
- Guest VLAN tagging and Hyper-V port VLAN policy must not conflict accidentally.
- Upstream switchport configuration remains an external dependency.
- Same VLAN number on two disconnected networks does not create connectivity.
First checks
Get-VMNetworkAdapterVlan -VMName *— VLAN per vNICSet-VMNetworkAdapterVlan -VMName <vm> -Access -VlanId 20— access VLANSet-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName Mgmt -Access -VlanId 10— host vNIC VLAN
Verify in this order
vNIC VLAN setting → vSwitch tags → trunk → physical switch
Where it usually breaks
First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.
Hyper-V → VLAN reference map
| Boundary | Meaning | Evidence limit |
|---|---|---|
| Guest | Tagged or untagged frame source | Must match design |
| VM port | Hyper-V VLAN policy | Configured ≠ forwarded |
| Uplink | External vSwitch/physical NIC | Still depends on upstream |
| Upstream | Switchport VLAN policy | Outside Hyper-V |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3705