Windows 10: Netnat

Discus and support Netnat in Windows 10 Virtualization to solve the problem; Thanks for your patience. Could someone tell me how to setup netnat for vm? I am running windows 10, and hyper-v on it. My pc connected to my router,... Discussion in 'Windows 10 Virtualization' started by BPsentinel, Nov 23, 2020.

  1. Netnat


    Thanks for your patience.

    Could someone tell me how to setup netnat for vm?
    I am running windows 10, and hyper-v on it. My pc connected to my router, which is my gateway, and I have pihole for internal dns. After reading almost all the blog articles, I found out that I understand nothing. I want to understand how the data from the vm reaches the internet.
    -First choice is the "default switch". How does that works? I found no nat, so checking upon the routing table, my best guess is that it is simply static routing. What I do not understand, is what steps does it take to reach the public address. First of all there is a network connection in the vm, which points to a vethernet connection on the host, and then... then what? I haven't found the address of my phisycal network card at any stage afterwards, so... as sad as it sounds, I gave it up.
    -Second choice is the "external switch". On top of the crazy stuff it does, I found a similar problem, that I do not see the connection between the vm and the phisical network card, and it ended up showing 2 nic at my router, so one network card with 2 ip address, and I could not find where the second one is assigned from, so where can I take control of it.
    -My last idea was to clean this up as much as I can, to take control of it. Using a "internal switch", and make it a nat, so the vm addresses would be translated to the host ip, and we are done. My issue is the gateway in this case. I get the internal part of the nat, but the external... so, should I point the external part of the nat to my host ip address?


    So to wrap it up? How does the default switch works, and what translates the vm ip addresses to my host ip?
    In case of an external switch, can I use just with my existing host IP address?
    With an internal NAT switch, should I point to my host ip?

    Thanks in advance!)

    :)
     
    BPsentinel, Nov 23, 2020
    #1
  2. RobV8R Win User

    How to remove a Hyper-V virtual Ethernet switch

    This was tested on Windows 10 1607.

    Short Answer, if you're using Docker:

    Long Answer:

    If you run into this situation and have Containers enabled or Docker installed, you'll need to stop Docker before you can remove the VMSwitch.

    As you can see, I have a VMSwitch named nat. I want it to go away.



    The answer turned out to be rather simple. Because I had configured the nat VMSwitch with a NetNat, I removed the NetNat. I'm unsure if this is a necessary step, but I did it anyway.

    Then I stopped Docker.

    And finally



    To make sure it was gone:

     
    RobV8R, Nov 23, 2020
    #2
  3. WojtekTM Win User
    Conflict between Chrome and Hyper-V default switch

    I have finally discovered that there is a bug in Windows 10.

    If you had configured NAT in Hyper-V with *-NetNat cmdlet before you installed Windows10 1709 (with new DefaultSwitch feature), your configuration of DefaultSwitch will be broken.

    Advices given by MS staff on MS support forums are useless, as disabling and enabling Hyper-V feature (with multiple reboots in between) does not reset Hyper-V configuration. It is also not possible to configure DefaultSwitch manually.

    15 Nov '18 Update:

    I have found blog entry: [ Managing the Hyper-V Default Switch in Windows 10 version 1709 and higher with PowerShell ] . Author suggests setting high metric on both IPv4 and IPv6 protocols of DefaultSwitch adapter:

    It does not resolve problem (DefaultSwitch still does not work), however I can use browsers without ERR_NETWORK_CHANGE errors.

    As no one in Microsoft knows how to repair their DefaultSwitch, probably the only complete solution is to make a clean install of 1809.
     
    WojtekTM, Nov 23, 2020
    #3
  4. Gary_MN Win User

    Netnat

    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. I'm assuming there is NAT set up behind the scene that
    supplies those IPs.

    To get around this issue I have set up a NAT 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 do 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" shows up. What am I missing? Or is my assumption incorrect?

    Thanks!
     
    Gary_MN, Nov 23, 2020
    #4
Thema:

Netnat