Being used to VMware Workstation, where NATing is a few GUI clicks away, I couldn’t find a GUI way of configuring it in Hyper-V. inside local outside hokey pokey; Turn yourself around I don’t mind the command line and actually prefer it sometimes. The PowerShell equivent didn’t end up being too bad. Not like the first time doing Cisco NAT from the CLI.
The first code block is the generic commands from the Microsoft reference document the second one is what I used in my lab. Create Internal vSwitch for NATNew-VMSwitch -SwitchName “SwitchName” -SwitchType Internal Configure the NAT gatewayNew-NetIPAddress -IPAddress -PrefixLength -InterfaceIndex Configure the NAT networkNew-NetNat -Name -InternalIPInterfaceAddressPrefix What I Used in My Lab New-VMSwitch –SwitchName “NATvSwitch” –SwitchType InternalNew-NetIPAddress –IPAddress 184.108.40.206 -PrefixLength 24 -InterfaceAlias “vEthernet (NATSwitch)”New-NetNat –Name myNATnetwork –InternalIPInterfaceAddres
Windows (WinNAT) only supports one internal NAT subnet prefix, trying to create multiple NATs will place the system into an unknown state. (1)