I received confirmation from the product team that support for multi NATs have been added to Hyper-V. Thanks everyone.
Windows 10 Hyper-V "Default Switch" question
Hi,
The VMs on Windows 10 Hyper-V set to use the default switch on Windows 10 Hyper-V receive dynamic IP addresses. There is no setting to set it to static IPs.
To get around this issue I have created an internal switch and set up a NAT to provide VMs external access to the wider LAN and everything works but came across a Hyper-V on Windows 2016 article that stated that on Windows only a single NAT is supported. Two questions:
1- Is is still the case on Windows 10?
2- When I issue "Get-NetNat" command, only my custom NAT shows up. I don't see the one which I assumed to be behind the "default switch" showing up. What am I missing? Or is my assumption incorrect?
Thanks!
Windows for business Windows Client for IT Pros Storage high availability Virtualization and Hyper-V
6 additional answers
Sort by: Most helpful
-
Leon Laude 86,026 Reputation points
2020-09-29T11:53:29.257+00:00 Hi @Garsha Rostami ,
Hyper-V on Windows 10 is different from Hyper-V on Windows Server, because it creates a default virtual switch in internal mode and automatically uses NAT on it.
You cannot change the default switch from dynamic to static.I'm not certain about the Get-NetNat PowerShell cmdlet, but it does not report the Default switch for some reason.
----------
(If the reply was helpful please don't forget to upvote or accept as answer, thank you)
Best regards,
Leon -
Garsha Rostami 126 Reputation points
2020-09-29T12:03:07.327+00:00 @Leon Laude
Hi and thanks for your response. I'm not trying to change the default switch, as stated I have created a new internal switch and set up a NAT to provide external access to VMs. The question was would this NAT interfere with the NAT behind the default switch as the docs state that there can only be one NAT per Windows? Thanks. -
Garsha Rostami 126 Reputation points
2020-09-29T12:46:10.257+00:00 I think yo are talking about switch and I'm talking about NAT. My assumption is that the default switch uses a NAT to allow VMs access to other VMs/devices outside the host, is that correct? I also created a NAT ("MyNATnetwork") and bound it to my virtual switch ("NewInternalSwitch") (see the print out of commands below). As you can see "Get-NetNat" returns only my NAT and not the one I thought would be bound to the "default switch". The docs says there can be only one NAT per host, so either the default switch is using some other technology or the single NAT rule has changed. I'm trying to clear this up. Thanks.
Get switchs
Get-VMSwitch
Name SwitchType NetAdapterInterfaceDescription
ExternalSwitch External Intel(R) Ethernet Connection (7) I219-V
NewInternalSwitch Internal
Default Switch Internal
WSL InternalGet NATS
Get-NetNat
Name : MyNATnetwork
ExternalIPInterfaceAddressPrefix :
InternalIPInterfaceAddressPrefix : 192.168.0.0/24
IcmpQueryTimeout : 30
TcpEstablishedConnectionTimeout : 1800
TcpTransientConnectionTimeout : 120
TcpFilteringBehavior : AddressDependentFiltering
UdpFilteringBehavior : AddressDependentFiltering
UdpIdleSessionTimeout : 120
UdpInboundRefresh : False
Store : Local
Active : True -
Garsha Rostami 126 Reputation points
2020-09-29T14:42:56.98+00:00 Thanks Leon for the help. The multi NAT on a host is still not clear to me so I leave this open so hopefully someone on the product team can provide clarification. In my case the following switches all use NAT (different network IDs and subnets):
My own internal switch
NewInternalSwitch Internal
Default switch that comes with Win 10
Default Switch Internal
WSL feature that provide Linux integration on Windows
WSL Internal
So if a single NAT rule is enforced then why/how these switches all use different NATs?