Multiple VLANs Using a Single Network Adapter on Windows 11 with Hyper-V

Multiple VLANs Using a Single Network Adapter on Windows 11 with Hyper-V

An encounter led me down a PowerShell rabbit hole, configuring multiple VLANs on Physical network adapter with Hyper-V running Windows 11.

#Hyper-V#Homelab#Cloudflare

As part of my homelab setup journey, I reached one of those seemingly tiny networking tasks that somehow turns into an evening of digging through documentation. I needed to make some changes to the LAN adapter on my laptop running Windows 11 Pro, so it could handle the VLAN traffic required by my lab (both tagged and untagged). This is alongside my main network that the router connecting to the internet.

Nothing particularly unusual for a homelab having multiple VLANs. But, the interesting part was that this laptop also runs Hyper-V, which I regularly use for creating VMs, testing configurations and generally experimenting with things before I put them into the actual lab. So I opened Hyper-V Virtual Switch Manager, selected my physical LAN adapter and started looking for the VLAN configuration I needed by replicating the same physical LAN over another VLAN tagged.

And that’s where things got interesting.

Hyper-V GUI Limitation (The Problem)#

Hyper-V manages physical network adapters through its Virtual Switch architecture. Once an adapter is assigned to an External Virtual Switch, Hyper-V takes over much of the networking configuration between the physical NIC, host operating system and virtual machines.

What I was looking for, however, wasn’t available as a simple multi-VLAN configuration option in the Hyper-V GUI. I could configure the adapter and virtual switch, but I couldn’t simply go back into the GUI and say: “I also want this physical adapter to handle another VLAN in this way.”

At first, I wondered if I had simply missed something. After a bit of digging, I realized I hadn’t. This is one of those cases where the GUI is only exposing part of what Hyper-V and Windows networking can actually do. More advanced configuration is available through PowerShell and the underlying Hyper-V networking cmdlets.

And that’s where my little networking problem turned into another homelab learning opportunity.

PowerShell To The Rescue (The Resolution)#

Rather than trying to force the Hyper-V GUI to do something it wasn’t designed to expose, I switched over to PowerShell upon reading some online posts. Hyper-V provides a fairly extensive set of PowerShell cmdlets for managing virtual switches, network adapters and VLAN configuration. That gave me the flexibility I was looking for and allowed me to configure the networking behavior directly instead of relying solely on the graphical interface.

And honestly, this was probably the more useful outcome. Here’s what I did:

  1. Open PowerShell with Admin privilege. Right click powershell on search and Run as Administrator.
  2. On the open dialog box, input below command to list all VM Switch adapters.
List down all VM Switches
C:\WINDOWS\system32> Get-VMSwitch
Name SwitchType NetworkAdapterInterfaceDescription
---- ---------- ----------------------------------
Ext-LAN External Realtek USB GBE Adapter
WLAN External Intel Wirless Adapter
DefaultSwitch Internal
  1. Take note on the name of the switch you would want create the VLAN. In this, I have chosen Ext-LAN as the Adapter to create the new VLAN and you can name the new interface where Your-New-Adapter-Name mentioned and the correct Adapter name where Existing-VMSwitch-Name is mentioned.
Creating a new VM Switch - for new VLAN
C:\WINDOWS\system32> Add-VMNetworkAdapter -ManagementOS -Name "Your-New-Adapter-Name" -SwitchName "Existing-VMSwitch-Name"
  1. Once the above command is executed, system will create the VM Switch adapter and we have to tag/input the VLAN in order to access the networ. During this setup use the exact name of the interface you created during step #3, next “-VMNetworkAdapterName” followed by the VLAN number next “-VlanId”.
Creating a new VM Switch - for new VLAN
C:\WINDOWS\system32> Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "Your-New-Adapter-Name" -Access -VlanId 20
  1. Upon configuring successfully, depending on the logical network (based on the VLAN network setup), your system will identify the network and obtain the IP address (assuming it is on DHCP).

What initially looked like a Hyper-V limitation turned into a reminder that when you’re working with Windows networking, the GUI isn’t necessarily the whole toolbox.

Although, this wasn’t a major blocker in my setup, but it’s exactly the kind of small issue that makes building a homelab interesting.

You start with: “I just need to configure a VLAN on my laptop.” Then a few searches later you’re learning about Hyper-V virtual switches, physical NICs, VLAN tagging and PowerShell cmdlets. And that’s part of the fun.

Not every homelab problem needs to become a huge architecture exercise. Sometimes it’s just one annoying checkbox that isn’t there — and the solution is discovering what’s happening underneath the GUI.

One more small networking puzzle solved. One more piece of the homelab understood.

Related Posts