Windows 10 Hyper-V - Finally a NAT Option...

Windows 10 Hyper-V - Finally a NAT Option...

Not sure about you but I've been waiting a long time for NAT to be part of HyperV on Windows client. The "other" guys have it - and for a long time too.

Now, with Nested Virtualization and NAT support, my world is nearly complete...

To enable it though on Windows 10, I don't believe there's anything in HyperV Manager that allows that.

But, PowerShell, and now that's x-plat too, to the rescue.

The below will create a single NAT device on the Virtual Switch and machines will be in the network. If you want to change that range, just be sure to update the gateway IP (below it's the - there's some CIDR notation too.

$natName = "NATSwitch"

New-VMSwitch -SwitchName $natName -SwitchType Internal

$interface = Get-NetAdapter | where {$ -like "*$natName*" }

New-NetIPAddress -IPAddress -PrefixLength 24 -InterfaceIndex $interface.ifIndex
New-NetNat -Name "MyNATNetwork" -InternalIPInterfaceAddressPrefix