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
Note: Once you set -NativeVlanId 0
you cannot then add a hn0.1
VLAN ID 1 as -NativeVlanId 0
knocks out using VLAN ID 1 if you set -NativeVlanId 1
you get VLAN ID 1 on the hn0
on the default interface, but you can't get an IP address on the Unifi "Native VLAN" 3
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