Windows – How to remove the VLAN ID from the NIC (Netadapter)

network-teamingnicpowershellvlanwindows

So I am running a Windows 2019 datacenter server core running hyper-v which has a
Broadcom Gigabit Ethernet BCM5720 NIC with 2 access ports. The Server is patched into a VLAN.

So earlier on I assigned a VLAN ID to the netadapter using powershell:

set-netadapter -name nic1 -vlanid 240

Later on I figured it would be a good idea to enable Switch Embbedded Teaming for the virtual switch:

Switch Embedded Teaming

Reading on the documention I read that if you use a virtual switch with teaming you should not put a vlanID on the NIC:
"2) Anytime you have NIC Teaming enabled, you must not set VLAN filters on the NICs using the NICs advanced properties settings. Let the teaming software or the Hyper-V switch (if present) do the filtering."

So finally my question. I am trying to remove the VLAN ID is set on the NIC, but I can't seem to find an easy way to this. The set-netadapter cmdlet doesn't seem to do it.

Anybody any idea how to deal with this?

Best Answer

It's simple:

You need to write this command in PowerShell:

Set-NetAdapter -Name nic1 -VlanID 0

where nic1 is the name of your adapter.

You can check VLAN on your interfaces this command in PowerShell:

Get-NetAdapter | select interfacealias,vlanid
Related Topic