Pcornel
Virtualization · Hyper-V

VLAN

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

Back to the Topic

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 vNIC
  • Set-VMNetworkAdapterVlan -VMName <vm> -Access -VlanId 20 — access VLAN
  • Set-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

BoundaryMeaningEvidence limit
GuestTagged or untagged frame sourceMust match design
VM portHyper-V VLAN policyConfigured ≠ forwarded
UplinkExternal vSwitch/physical NICStill depends on upstream
UpstreamSwitchport VLAN policyOutside 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

Confirmation

Confirm action

Continue?