To allow nested VMs to reach the physical network through the outer Hyper-V VM, enable MAC address spoofing on the outer VM’s network adapter.
- Shut down the outer VM if needed.
- On the physical host, open PowerShell.
- Run:
Get-VMNetworkAdapter -VMName <VMName> | Set-VMNetworkAdapter -MacAddressSpoofing On
Replace <VMName> with the name of the outer VM that is hosting the inner Hyper-V guests.
Why this is needed:
- Nested VM traffic passes through two virtual switches.
- Hyper-V requires MAC address spoofing on the first-level VM adapter so packets from the nested guests can be routed correctly.
If connectivity still fails after enabling spoofing, check these items:
- The nested VM is connected to an External virtual switch, not Internal or Private.
- The outer VM is using the correct external network adapter.
- Windows Firewall or security software is not blocking traffic.
- If MAC spoofing cannot be used, configure NAT instead.
If NAT is required in the outer VM, the documented setup is:
New-VMSwitch -Name VmNAT -SwitchType Internal
New-NetNat –Name LocalNAT –InternalIPInterfaceAddressPrefix “192.168.100.0/24”
Get-NetAdapter "vEthernet (VmNat)" | New-NetIPAddress -IPAddress 192.168.100.1 -AddressFamily IPv4 -PrefixLength 24
Then assign each nested VM an IP in that subnet and use 192.168.100.1 as the gateway.
References: