Use this topic when a VM is connected to the correct vSwitch but cannot reach peers or upstream networks due to suspected VLAN mismatch.
VLAN · Hyper-V
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.
1. Hyper-V tags VLANs per vNIC (access, trunk, isolated, PVLAN).
2. Physical switch port must trunk the VLANs.
3. Untagged = VLAN 0 (native on the switch).
4. Host vNICs need VLANs too in converged setups.
5. Check VLAN after VM moves.
vNIC VLAN setting → vSwitch tags → trunk → physical switch
Verify packet tagging/forwarding at the next physical-network boundary.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
It does not show upstream switch configuration or return-path correctness.
Next check: Verify packet tagging/forwarding at the next physical-network boundary.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
Guest frame/tag behavior → VM vNIC port VLAN policy → Hyper-V vSwitch → physical uplink → upstream VLAN forwarding → return path
Step 2 Effective-state and workload closure Verify boundary
Correlate guest counters/routes with virtual-port and uplink counters for the same test, validate VLAN/policy on the exact path, then repeat the original guest transaction.
Local intent: Hyper-V VLAN configuration applies 802.1Q segmentation policy to virtual switch ports so VM or management-OS traffic is associated with the intended VLAN context.
Step 3 Branching troubleshooting Narrow the fault
Concrete boundaries: guest socket/route → virtual NIC → host/hypervisor queue → bridge/vSwitch/port group → VLAN/security policy → physical uplink → external network → return → guest workload.
Path: Virtualization → Hyper-V → VLAN. Local intent: Hyper-V VLAN configuration applies 802.1Q segmentation policy to virtual switch ports so VM or management-OS traffic is associated with the intended VLAN context.
Step 4 Where it fails Narrow the fault
Common failure classes are stale inventory, asynchronous task overlap, lock conflict, capacity pressure, guest-agent lag, inaccessible dependency, placement mismatch or management/runtime divergence. Also consider stale management inventory, asynchronous task overlap, host capability mismatch, guest-agent/driver lag, CPU feature masking, NUMA pressure, backing-store latency, bridge/VLAN mismatch, MTU mismatch, snapshot chains, lock ownership and partial cluster membership.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- 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.
Get-VMNetworkAdapterVlan -VMName *— VLAN per vNICSet-VMNetworkAdapterVlan -VMName <vm> -Access -VlanId 20— access VLANSet-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName Mgmt -Access -VlanId 10— host vNIC VLAN
ReferenceWhat it is1 section · depth on demand
In depth
In Hyper-V, VLAN tagging is set per virtual network adapter. The Hyper-V switch tags frames from the VM with the configured VLAN ID and strips tags towards it, so the guest sees untagged traffic. The physical switch port connected to the Hyper-V host must be a trunk carrying those VLANs.
Set-VMNetworkAdapterVlan -VMName app01 -Access -VlanId 120
Set-VMNetworkAdapterVlan -VMName fw01 -Trunk -AllowedVlanIdList '100-199' -NativeVlanId 0
Get-VMNetworkAdapterVlan -VMName app01
Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName Management -Access -VlanId 10
| Mode | Use |
|---|---|
| Access | Normal VMs in one VLAN |
| Trunk | VMs that handle tags themselves (firewalls, routers) |
| Untagged | Uses the native VLAN of the physical port |
| Isolated/Community (PVLAN) | Private VLAN isolation |
With Switch Embedded Teaming (SET), all team members must carry the same VLANs on the physical switches.
ReferenceWhy it matters1 section · depth on demand
Internals and state
A guest packet leaves the guest IP stack through a virtual NIC, is processed by hypervisor/host tap or synthetic device queues, traverses a bridge/vSwitch/port-group and VLAN/security policy, then reaches a physical uplink and external network.
Management-plane “connected” state does not show VLAN admission, host forwarding, offload behavior or return traffic.
Local intent: Hyper-V VLAN configuration applies 802.1Q segmentation policy to virtual switch ports so VM or management-OS traffic is associated with the intended VLAN context.
ReferenceHow it works1 section · depth on demand
How it works
How it works: A guest packet leaves the guest IP stack through a virtual NIC, is processed by hypervisor/host tap or synthetic device queues, traverses a bridge/vSwitch/port-group and VLAN/security policy, then reaches a physical uplink and external network. Management-plane “connected” state does not show VLAN admission, host forwarding, offload behavior or return traffic.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
Correct Hyper-V VLAN configuration shows intended virtual-port policy, not upstream VLAN membership or end-to-end reachability.
A guest packet leaves the guest IP stack through a virtual NIC, is processed by hypervisor/host tap or synthetic device queues, traverses a bridge/vSwitch/port-group and VLAN/security policy, then reaches a physical uplink and external network. Management-plane “connected” state does not show VLAN admission, host forwarding, offload behavior or return traffic. Close with Correlate guest counters/routes with virtual-port and uplink counters for the same test, validate VLAN/policy on the exact path, then repeat the original guest transaction. and state what the evidence does not show.
Mechanics
Follow the path in order: management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back. It can coexist with stale placement, missing guest drivers, wrong VLAN/bridge mapping, inaccessible backing storage, CPU incompatibility or a workload that cannot use the resource.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Hyper-V → VLAN. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows-server/virtualization/hyper-v/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Hyper-V → VLAN reference map
Fast Hyper-V boundaries for Hyper-V → VLAN.
| 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 |