Skip to content
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 virtual networking; NAT and IPv6 #418

Closed
gbraad opened this issue Feb 16, 2017 · 15 comments
Closed

Hyper-V virtual networking; NAT and IPv6 #418

gbraad opened this issue Feb 16, 2017 · 15 comments

Comments

@gbraad
Copy link
Member

gbraad commented Feb 16, 2017

When a VM is started on Hyper-V, connected to a virtual switch that is configured for NAT, the virtual machine will not receive an IPv4 address (as no DHCP server runs), but gets assigned a IPv6 address. Eg. when using 'DockerNAT'.

However, this leads to unexpected behaviour. The VM is 'Running', but SSH can not connect (and the process seems to be hanging). On a separate cmd prompt the following can be seen:

C:\Users\gbraad\Downloads>minishift ip
fe80::215:5dff:fe15:7804

Related to: #417

@lucastheisen
Copy link

lucastheisen commented Jun 20, 2017

I think this may be related to my problem as well... Th only difference is that when i run start it never gets past this:

PS C:\Tools\minishift> minishift start
Starting local OpenShift cluster using 'hyperv' hypervisor...

Using hyperv manager, i can Connect... to the vm and watch it boot all the way to the root prompt:

image

Also, inside of hyperv manager i can see an IPV6 address assigned under the network tab... But then it just hangs.

@gbraad
Copy link
Member Author

gbraad commented Jun 20, 2017

@lucastheisen we have since provided a way to select the networking switch https://docs.openshift.org/latest/minishift/getting-started/setting-up-driver-plugin.html#hyper-v hopefully this helps. Do you have Docker for Windows installed?

@lucastheisen
Copy link

@gbraad, I did set up my network switch in that fashion. Created one according to the instructions you linked to on the Microsoft page... The only difference being that I created it as an internal Network with NAT...

@gbraad
Copy link
Member Author

gbraad commented Jun 21, 2017

@LalatenduM @hferentschik one of the things we can do on startup is to throw an error when the host has two (or no) virtual switches, and of course report which one is used

@gbraad
Copy link
Member Author

gbraad commented Jun 21, 2017

@lucastheisen The text mentions "set the environment variable HYPERV_VIRTUAL_SWITCH to the name of the external virtual switch" Modifying the first part by explicitly mentioning "an External Virtual Switch" (#1051)

At the moment we do not support NAT or Internal, as they do not provide the necessary DHCP functionality.

@lucastheisen
Copy link

@gbraad, I did see that, but thought this issue was about getting NAT support, so I hoped that little please was outdated (given that docker for Windows has this feature). Without NAT, my team is out of luck, as corporate won't assign ips to non-corporate managed images. If I keep watch on this ticket will it let us know when NAT is supported?

@LalatenduMohanty LalatenduMohanty added this to the v1.4.0 milestone Jun 27, 2017
@LalatenduMohanty LalatenduMohanty removed this from the v1.4.0 milestone Jul 19, 2017
@carljmosca
Copy link

Is NAT support expected for v1.4.0?

@gbraad
Copy link
Member Author

gbraad commented Jul 22, 2017 via email

@carljmosca
Copy link

Ok thank you for the update.

@gbraad
Copy link
Member Author

gbraad commented Aug 17, 2017

@LalatenduMohanty @praveenkumar @hferentschik @budhrg

I think we need to consider including this to the current milestone... Even though I might not be able to work on it instantly, we need to do something about this ASAP.

@gbraad
Copy link
Member Author

gbraad commented Aug 22, 2017

Easy way to setup for testing:

Note: I assume you have Docker for Windows installed

C:\Users\gbraad>set HYPERV_VIRTUAL_SWITCH=DockerNAT

C:\Users\gbraad>minishift start --iso-url centos
-- Checking if Hyper-V driver is configured ... OK
-- Starting local OpenShift cluster using 'hyperv' hypervisor ...
-- Minishift VM will be configured with ...
   Memory:    2 GB
   vCPUs :    2
   Disk size: 20 GB
-- Starting Minishift VM ... -

After a short while, open another command prompt:

C:\Users\gbraad>minishift status
Running

C:\Users\gbraad>minishift ip
fe80::215:5dff:fe15:7883

C:\Users\gbraad>minishift ssh
Command failed: IP not found

image

Changing IP to the DockerNAT settings will work:
image
In this case ifconfig eth0:1 10.0.75.128 netmask 255.255.255.0

@lucastheisen
Copy link

@gbraad , are you saying I should try setting the eth0 in the minishift instance to match the docker config as a workaround? Or are you commenting so that the other members of the project have a way to begin to work on NAT support?

@gbraad
Copy link
Member Author

gbraad commented Sep 1, 2017

You can assign an IP address to the VM in the Docker NAT range, and this will work. It might however clash with the IP addresses that are handed out already to a container, but generally you can do this. As one of the solutions we are working on #1316, and coordinate with Minikube to get a general solution.

We are still looking into other solutions.

@LalatenduMohanty LalatenduMohanty modified the milestones: v1.7.0, v1.8.0 Sep 20, 2017
@gbraad
Copy link
Member Author

gbraad commented Sep 28, 2017

@lucastheisen We have worked on a static IP option which allows you to use the NAT functionality. Please see #1316 (comment) for more information.

Closing this issue

@gbraad
Copy link
Member Author

gbraad commented Oct 5, 2017

Added #1500 to look into the IPv6 support, as this needs to be addressed in general (across all hypervisors)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants