Forum Discussion

kapalkat's avatar
kapalkat
Copper Contributor
Aug 13, 2019

Windows 10 hyper-v default switch problems when VPN turned on

Hey I have following problems with my guests VMs:

Host OS:

Windows Pro latest edition: 1903.
Hyper-V on.
I am using Default Switch for my guest VMs.
Its configuration is default; IP is set to:
IP: 192.168.224.241
Netmask: 255.255.255.240
Gateway: empty
DNS: empty
My quest is configured in a following way:
IP: 192.168.224.242
Netmask: 255.255.255.240
Gateway: 192.168.224.241
DNS: 192.168.224.241

This configuration works OK on guest ( I have the Internet access and host connection) until I turn on a corporate VPN.
When the host VPN is turned ON I loose the ability to connect to the Internet on my Hyper-V guest.

What's wrong? I though that the default switch should manage this kind of situation. How I can change the configuration to make it working properly?

 

BR

Tomek

  • vinzBad's avatar
    vinzBad
    Copper Contributor

    kapalkatHi I had the same problem and solved it by reducing the MTU of NIC in the guest vm.

     

    In the guest vm:

    run cmd with admin privileges

    netsh interface ipv4 show interfaces

    netsh interface ipv4 set  interface "Ethernet" mtu=1300

  • You should create a new Virtual network adapter in Hyper-v virtual switch manager, make it an external one and attach it to your physical network adapter which is connected to your computer and gives you Internet access.
    after that go to the Guest OS and give it an static IPv4 address that is on the same subnet as your host, set default gateway to your physical router's IP address and DNS servers to something like: 8.8.8.8-8.8.4.4 (Goolge's) or 1.1.1.1-1.0.0.1 (CloudFlare's).
    this method is guaranteed to work, let me know if you have problem setting it up.
    • kapalkat's avatar
      kapalkat
      Copper Contributor

      HotCakeX Thanks for your reply. I had gave it a try but instead using google DNS I used the exact same DNS as on my host which is my router gateway address. All was looking OK; the guest had the Internet connection and it was able to ping any web address.

      Then I tried to start the VPN (L2TP/IPsec vpn) but the host was not able to connect. I was receiving rejections. I have deleted the external VNIC and I was able to connect to the VPN again. Seems like this configuration is breaking my VPN connection.

      The other downside for this configuration is that I am switching the networks quite often; from cable to WIFI, from one WIFI to another and this configuration would require constant changes on my guest. 

      • HotCakeX's avatar
        HotCakeX
        MVP

        I have the same config and it's working fine for me. not sure if it's relevant but I'm on Windows 10 insider 18956.
        i'm using custom DNS (cloudflare's) on my host and 3 VMs that i have (Windows server 2019 and Windows 10 pro). they all use the Same external virtual network adapter and they're all on the same subnet as my host, have static IP too which is mandatory for my servers.
        my network adapter is a USB WIFI adapter. my VMs all have direct connection to the internet, whether or not my host is using VPN.

        when you switch from WIFI to cable you just have to go to virtual switch manger in Hyper-v and attach your other network adapter to the external vNIC.

    • PhaedraV's avatar
      PhaedraV
      Copper Contributor

      HotCakeX that does not do nearly the same thing.

      Sure you can set up vms with an external adapter, static or dhcp.

      but the Internal net should still get dns when the host is switched to vpn.

       

  • WideBody's avatar
    WideBody
    Copper Contributor
    I have this same problem. It seems my guest OS shares the VPN connection. I want an independent connection from the Guest OS. When I try to create the External Switch, it breaks my wi-fi connection (Killer WiFi AX1650). Frustrating.

Resources