asked on
Hyper-V VM in VLAN cannot ping pfSense VM
I am setting up a test environment using Hyper-V VMs, as follows:
- W10-01 is a Windows 10 VM on the default VLAN (1). It has one network adapter, connected to a Hyper-V Virtual Switch named 'Lab01'. IP Address 192.168.22.10
(Lab01 is a Private Switch)
- W10-02 is a Windows 10 VM on VLAN 20. It also has just one network adapter. It's connected to the same Virtual Switch but the VLAN ID is set to '20'. IP Address is 10.1.1.18
The objective is to use a pfSense VM as the gateway for both VLANs, and also to allow traffic between the 2 VLANs - 192.168.22.0/24 and 10.1.1.0/24
The pfSense VM has 2 network adapters:
- NIC 1 is connected to the same Virtual Switch as the 2 VMs above. This is the pfSense LAN interface. IP Address 192.168.22.1
- NIC 2 is connected to an External Virtual Switch. It's for the WAN interface on pfSense. IP Address is a public IP.
W10-01 can get to the internet just fine.
However W10-02 (the workstation that is on VLAN 20) cannot get to the internet.
From W10-02 I can't even ping the IP address of the pfSense
More info:
In pfSense I created VLAN 20 and assigned it to NIC 1. So NIC 1 has 2 IP addresses - 192.168.22.1 and 10.1.1.1
As a test, I created a firewall rule that allows all traffic from VLAN 20 to anywhere, over any port. There are no explicit deny rules (yet) for VLAN 20. No NAT. No static routes.
The computer on VLAN 20 having IP address 10.1.1.18 cannot ping the pfSense at 10.1.1.1. IP settings are manual. 10.1.1.1 is the gateway. Subnet mask is correct. Tried deleting and recreating the VLAN on pfSense. VLAN interface is enabled. What am I missing?
ASKER
Set-VMNetworkAdapterVlan -VMName pfVM -VMNetworkAdapterName "InternalNic" -Trunk -AllowedVlanIdList "1,20" -NativeVlanId 1
Now this network adapter can carry traffic on VLAN 1 and VLAN 20
ASKER
Philip, looks like we both had the same idea. The only catch was this: When you add multiple network adapters to a VM (using Hyper-V Manager), Hyper-V is happy to give them all the exact same name :-/
So I did a bit of PowerShell to get the MAC address of each NIC; then used PowerShell to rename them.
In-guest the vNICs would be "Ethernet", "Ethernet 2", "Ethernet 3", ETC. They should not have the same MAC address.
ASKER