Link to home
Start Free TrialLog in
Avatar of tonelm54
tonelm54

asked on

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

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?
Avatar of Jackie Man
Jackie Man
Flag of Hong Kong image

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/
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
Avatar of tonelm54
tonelm54

ASKER

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?
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.
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.
ASKER CERTIFIED SOLUTION
Avatar of tonelm54
tonelm54

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for your assistance