Hyper-V Nat, worked fine on 192.168.0.2 but not on 192.168.10.2

tonelm54
tonelm54 used Ask the Experts™
on
I have a VM using Windows 10 and Hyper-V, I setup a NAT network connection, so:-

HyperVisor (Windows 10)
IP Address - 192.168.0.1
Subnet - 255.255.255.0
Gateway - Nothing
VM (Windows 7)
IP Address - 192.168.0.2
Subnet - 255.255.255.0
Gateway - 192.168.0.1

And all worked fine user could connect to the web fine, however when I sent the laptop to the user he connected it to his wireless router which gave him an IP address of 192.168.0.22 (obviously got confused in the routing tables), so I changed the NAT config to:-

HyperVisor
IP Address - 192.168.10.1
Subnet - 255.255.255.0
Gateway - Nothing
VM
IP Address - 192.168.10.2
Subnet - 255.255.255.0
Gateway - 192.168.10.1
And internet didnt work. Strange thing is I can ping 192.168.10.1 from the VM, and I can ping 192.168.10.2 from the hypervisor. Default route on the VM is 192.168.10.1 but if I tracert to 8.8.8.8 it doesnt even get to the fist hop which as far as I understand should be the hypervisor 192.168.10.1  .

The reason Im using a Natted connection is that I cant have 2 IPs on the wireless controller on the laptop, so just have one and a nat connection. Reason Im using Windows 7 is the customer needs to connect to a website that only runs on IE9 and cant downgrade his Windows 10 PC to use IE9 :-S

Any ideas or anything I can do to troubleshoot the issue?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Jackie Man IT Manager
Top Expert 2010

Commented:
You need to enable Internet connection sharing of your win 10 hyper v host.

https://www.groovypost.com/howto/share-an-ethernet-or-wireless-network-connection-with-hyper-v-in-windows-10/
MaheshArchitect
Distinguished Expert 2018

Commented:
I believe 192.168.0.0/24 is hard coded in NAT table and hence it won't accept 192.168.10.0/24 addresses

U can ping back and forth because its valid host to guest network

Author

Commented:
Thinking about it, I didnt add a new NAT rule in when I changed the IP address range like 'Mahesh' suggested, so I added the rule in using Powershell:-
New-NetNat –Name "Wireless NAT-10" –InternalIPInterfaceAddressPrefix 192.168.10.0/24 –Verbose

Open in new window


So now I can see both rules in my NAT config:-

Name                             : Wireless NAT
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

Name                             : Wireless NAT-10
ExternalIPInterfaceAddressPrefix :
InternalIPInterfaceAddressPrefix : 192.168.10.0/24
IcmpQueryTimeout                 : 30
TcpEstablishedConnectionTimeout  : 1800
TcpTransientConnectionTimeout    : 120
TcpFilteringBehavior             : AddressDependentFiltering
UdpFilteringBehavior             : AddressDependentFiltering
UdpIdleSessionTimeout            : 120
UdpInboundRefresh                : False
Store                            : Local
Active                           : True
But the VM still isnt seeing the internet :-(

Any ideas?
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

MaheshArchitect
Distinguished Expert 2018

Commented:
Even if you disable or delete NAT virtual network adapters created by Hyper-V / manual creation, during next reboot default NAT adapter will get created with 192.168.0.0/24 segment which is default segment, infact ICS also use same segment. Hence I doubt 192.168.10.0/24 would work.
Top Expert 2016

Commented:
I don't use the default network that comes with windows 10
set up an external switch and bind it to the physical network adapter, check the box to allow management, then in the vm set it to use the external switch you just created.
Commented:
Your not going to belive this, but in the time the laptop was in transit to the user, our parent company pushed out a new firewall policy that blocks all VM traffic when not on the corprate network, why I have no idea.

Disabled the firewall and works fine, now to shoot the person who deplyed the rule without telling me :-(

Author

Commented:
Thank you for your assistance

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial