-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hyper-v: docs and feature to make easy NAT networking setup #1627
Comments
We have the same issue with Minishift. We have recommended people before to use a simple DHCP server on the virtual switch:
However, as I remember, this shortcoming of the Hyper-V Virtual Networking stack will be addressed in coming versions (just when is unknown). I would rather find a solution in which the IPv6 address that actually gets assigned is usable. Or you didn't get one? Might be that the MobyLinuxVM (DFW) and CentOS image we use might react differently. |
When I create a NAT using https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/setup-nat-network
I get an ipv6 address for minikube but kubectl is unable to interact with the cluster.
It seems the VM can't reach the internet so the switch isn't configured properly
EDIT: it's the same issue as minishift/minishift#418 |
@aaron-prindle minishift/minishift#418 We have the same issue. The IPv6 address does not allow connectivity either. Haven't been able to spend a lot of time on it yet, but when assigning a static IP address to the VM (or have DHCP hand a IPv4 address, www.dhcpserver.de) it will work as expected. |
I configured the go dhcp server as you suggested and it appears to be working now.
It seems that the pods are still not resolving thought, need to investigate.
|
There are some known limitations with the NAT implementation on Windows: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/setup-nat-network
This means that when someone has installed Docker for Windows we might run into some problems when re-using the This is however the easiest solution... |
For Minishift I have been looking to use the Data Exchange service that Hyper-V adds to the VM. When the Hyper-V agents are installed in the guest, it is possible to exchange simple data structures using a key-value pair. Part of this spike can be found at: minishift/minishift#1293 This way it is possible to assign an IP address on start, with for instance a flag Note; a solution for the other hypervisors will likely have to be a two stage boot when a static IP address is needed (pretty much like the IP change scripts we have seen as workarounds :-( ) |
Note: Implementation task for a static IP address on HyperV and Minishift: minishift/minishift#1316 |
PR with a possible solution is available at Minishift's repo for testing. Instructions are here: minishift/minishift#1316 (comment) Command looks like:
|
Note that step 2 might fail because of #754. Either disable IPv6 in the "Default Switch" adapter or try step 2 again (and again and again) until it selects an IPv4 address. |
Sadly that doesn't work. It seems I just got lucky the first few times I tried it. |
@briansmith I have setup many hosts (through installing 1703 as update) and I have never seen the "Default Switch" with DHCP. Also, I find no reference that the Creator's Update offers DHCP. I guess you mean to say 1709 (Fall Creator's update): https://blogs.technet.microsoft.com/virtualization/2017/11/13/whats-new-in-hyper-v-for-windows-10-fall-creators-update/. It is identified by ID: |
Yes, that's right. |
this means the documentation might have to include two situations.
Note: the roll out of the Fall Creators update is still on-going, and not always applies successfully. Will have to try using the "Default Switch" and see how IPv6 is handled. |
The same restrictions apply: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/setup-nat-network#troubleshooting Onlu one NAT network is available per host. You can verify if you have one with the command:
If you have a NAT network, it will render the "Default Switch" interoperable. It will assign an IP address, such as |
Can you check what ends up in your |
I've read through this thread half a dozen times. I'm still not sure what I should try. I have Docker for Windows installed but if I try to use "DockerNAT" it seems to assign a IPv6 IP and just fail. Any help would be appreciated. |
@briansmith Using Get-NetIPInterface -InterfaceAlias "vEthernet (Default Switch)" -AddressFamily IPv4 | Get-NetIPAddress | ForEach-Object { $_.IPAddress } seems to provide me with the correct address for use as DNS (and Gateway) for the VMs on the "Default Switch". |
@djensen47 make sure you have used |
Isn't there an issue if DockerNAT is already on the system? |
DockerNAT is not a real NAT-enabled network. It uses VPNKit to provide this behaviour instead |
When it works doing
When it doesn't work...I'm not sure, because I haven't been able to reproduce the problem where an IPv6 address is chosen by the |
By now, I was able to start minikube with Internal Switch using IPV4 My environment: Running Docker for Windows with Hyper-V
I needed to create the internal switch:
And create the NAT: Start the minikube using the Switch: Then:
|
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Minishift is currently considering the use of the "Default Switch" as the
network to use wen nothing is configured. This will greatly simplify the
setup
|
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
My experience using the "Default Switch" with minikube 0.25 is that it sometimes works and sometimes doesn't. In particular I still run into the "I got an IPv6 address that doesn't work" problem that is reported in various issues here. (I suspect the IPv6 address is some link-local address or another kind with limited connectivity.) I've tried all the workarounds regarding disabling IPv6 in various ways to no avail. The only workaround I know of is to "minikube stop && minikube start" until it works. IMO getting the "Default Switch" working would make minikube much more usable on Windows. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Environment:
When I create a NAT using https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/setup-nat-network
|
Environment:
What happened:
Setup a NAT on windows and booted minikube. Minikube gets no IP!!
What you expected to happen:
IP
How to reproduce it (as minimally and precisely as possible):
Create NAT: https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/user-guide/setup-nat-network
Use that switch:
If you run the demo DHCP server on the NAT everything works! https://github.com/krolaw/dhcp4
Anything else do we need to know:
I intend to turn this sketch into real docs and feature.
The text was updated successfully, but these errors were encountered: