]> Posts for December 2022 🌐:aligrant.com

Creating multiple VLANs on Windows 11

Alastair Grant | Friday 16 December 2022

I tend to deal with VLANs at the switch, but I've run out of ports and I need to use multiple VLANs on a workstation.  So instead, I figured I'd tag the other VLANs and let the Intel PROSet utility handle creating multiple nics.  Although it seems, Intel no longer supports creating VLANs on Windows 11 (or even, recent versions of Windows 10).

A popular link discusses the use of IntelNetCmdlets Powershell Modules to handle this, but again, this isn't something that's currently available from Intel.  There is now an IntelEthernetCmdlets, but these do not allow you to setup VLANs.

Instead, the answer lies with Hyper-V.  Hyper-V is Microsoft's virtualisation platform and allows for virtual machines to run in Windows.  Now we're not wanting to create a virtual machine, but we do want to create a virtual network interface that we can tag against a VLAN.

For this you will need to have installed the "Hyper-V Module for Windows PowerShell" through Windows Features.  Whilst there is a GUI for doing network configuration, I could not get the control I needed to set this up.

Creating a vSwitch

First of all you need to define a new virtual switch, this is basically a hidden Network Bridge that allows virtual NICs to talk to the physical NIC.  You will need to do this from an Administrative PowerShell.

New-VMSwitch -name vLanSwitch -NetAdapterName <physical nic name> -AllowManagementOs $true

Replace <physical nic name> with the interface name in Windows (usually "Ethernet" if you only have one).  This creates a virtual switch, but also a virtual network card on your computer with the same name.  Any untagged traffic will be available on this interface.  If for whatever reason you need to manually create the default interface, use the command below with the -Passthru argument.

Creating a tagged virtual nic

We then need to create a new virtual network card, and then assign it to a VLAN.

Add-VMNetworkAdapter -ManagementOS -Name VLAN77 -SwitchName vLanSwitch

Change the name to whatever makes sense to you.

Set-VMNetworkAdapterVlan -VMNetworkAdapterName VLAN77 -VlanId 77 -Access -ManagementOS

The key to both these commands is to use the -ManagementOS switch, which creates these changes against the host OS and not a virtual machine.

You can carry on adding as many VLANs as you need and they will appear in Windows as a network card and the tagging is taken care of you.

Breaking from the voyeuristic norms of the Internet, any comments can be made in private by contacting me.

Entries for: December 2022

Previous Next