Getting a Hyper-V Hosted PFSense VM to send untagged traffic out the default Non-VLAN interface to the Unifi Native VLAN which isn’t the default VLAN 1

by Aug 11, 2025IT Tips0 comments

pfSense 2.8.0 CE VM with one interface and wanting to do Router on a Stick in Hyper-V VM

Powershell command to configure the Hyper-V VM Network Adapter to allow Multi-VLAN and a default Native VLAN on Unifi

# Set Hyper-V adapter to be a trunk port and don't tag anything on the Native VLAN
# specify your own allowed VLANs or a range
Set-VMNetworkAdapterVlan -VMName PFSENSE280 -Trunk -NativeVlanId 0 -VMNetworkAdapterName "Network Adapter" -AllowedVlanIdList "80,114,120-180"

# view 
Get-VMNetworkAdapterVlan -VMName PFSENSE280 -VMNetworkAdapterName "Network Adapter"

VMName     VMNetworkAdapterName Mode  VlanList
------     -------------------- ----  --------
PFSENSE280 Network Adapter      Trunk 0,80,114,120-180

The pfSense base interface name is hn0 and that will send untagged traffic on to the wire. The secret is tell the Hyper-V interface using -NativeVlanId 0 to not add a tag "don't tag anything untagged"

Hyper-V host is plugged into Ethernet port with a Native VLAN / Network of VLAN 3 NOT the default of 1

With -NativeVlandId 0 the following doesn't work MGMT doesn't get an IP address hn0 is the default VLAN (1) so you can't have two of the same

This command accomplishes creating a Trunk interface with no tagging for traffic on the Native VLAN (in this case it's 3 but could be any). The important part is -NativeVlanId 0

Hyper-V VM PFsense adapter is connected to a Switch connected to the External Hyper-V Host Physical Adapter

What it looks like in the pfSense console

 HOME (wan)   -> hn0.80  -> v4/DHCP4: 10.18.80.143/24
 OFFICE (lan) -> hn0     -> v4/DHCP4: 10.196.3.141/24
 GUEST (opt1) -> hn0.114 -> v4/DHCP4: 172.16.114.197/24

The network adapter

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.