Forum Discussion
Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
I guess we'll see!
-Jake
I was so happy when I found your "solution" for this default switch nightmare...
Unfortunately it didn't help. The default switch just don't want to be deleted. As far as I'm aware it cannot be deleted. Though your solution did create another default switch. So what if I just change the priority and then lower the "grey"/unmodifiable default switch to be the lowest priority?
But anyway anyone can get this work?
My original issue is kind of the same as the original topic.
I would like to create an internal network of Servers on one laptop for testing / migration purposes.
Main connection to internet Wifi Network.
Default Switch would provide internet connection. Currently unable to set IP or fix address, just doesn't work if you move your laptop, connect to another WIFI network. So this cannot be touched, I have t leave it on automatic.
I have to create 2-3 separate Servers, with their own internal network card.
The problem is that as soon as I would like to set static ip for internal network, I'm unable to get internet connection. Default Switch constantly changing ip address/range (really silly ranges every computer restart even). Targeting the default switch as default gateway doesn't work.
What should be the proper topology/setup for this please? I really don't even know how others do this, in data centers, with hundreds of VMs, with different ip addresses, ranges, etc. when I'm struggling with 2-3 lousy server emulation. 😄 I might have very limited knowledge.
All help appreciated.
- Ethan_CDec 09, 2020Copper Contributor
Peter_H0 This is getting a little off topic, but I hope this helps:
The 'default switch' is an internal network inside hyper-v on your machine that changes every reboot (but that should not matter for your use case) which has NAT access to the "real" network via your wifi card. The VM's on your machine on the default switch should be able to talk to one another, and again have internet access via network address translation to your machines wifi address.
If you want your VM's to have addresses on the wifi network, you need to add a new switch in the Hyper-V Virtual Switch Manager, and set it to 'external' - this will make the servers you build act like real clients with their own IP addresses on the same network as your wifi card. So now instead of having 1 IP address for your machine, you will need 3 to run your machine and the two servers.
If you absolutely want the servers to have their own private (but fixed IP address range) network; that is NOT part of the "real" network; but you want that network to have a route to the internet, you will need to make a new switch in the Hyper-V Virtual Switch Manager, and set it to 'internal' and add those servers to that new network switch. You will also need a separate external virtual switch, and a 3rd VM attached to both the internal and the external virtual networks, and you'll have to install and manage a (free) virtual firewall appliance (or OS with routing capabilities) on that 3rd VM and set it up to do NAT or routing between the networks. In this scenario you will need 2 IP addresses on the "real" wifi network no matter how many VM's you add to your internal virtual switch, and their IP's can be static on that private internal network.
- Peter_H0Apr 19, 2021Copper Contributor
Ethan_C Hi,
Yes I've solved this issue in a way. I've set up a nat, that works well with multiple VMs.
However not perfect, since I have issues via Wifi still. Namely, OpenVPN game me silly errors, had to disable virtual network in order to use through Wifi, etc. Kind of a nuisance but well, hyper-v is "free" vs. the other solution that others mentioned above. 🙂
Not to mention if you want to know better the azure cloud you should know hyper-v better too so thats my other reason why I muck around with Hyper-v.
- SoulChild112Apr 19, 2021Copper Contributor
Exactly, the reason I wanted to go to hyperV from other solution is because it's a very performant hypervisor that's included with windows.
It would be nearly perfect, if it weren't for this silly and very unnecesairy "feature".
- SoulChild112Apr 09, 2021Copper Contributor
I found this topic because I had exactly the same frustration with the default switch.
I was thinking I was stupid because it kept changing subnet after every reboot.
Turns out, it works as designed(by an idiot, no doubt)
So fine, I figured: I will just use the external switch, shees.
So I did.
Suddenly, my internet speed dropped to 1 megabit/second
Turns out, on some network cards, that's a bug.
So... I have a completely unusable network-stack on hyper-v now. Thanks Microsoft.- Ethan_CApr 09, 2021Copper Contributor
SoulChild112 I don't recall if I cross posted to this thread before. here is my temporary workaround to control the default switch hyper-v and WSL network segments from reboot to reboot.
https://github.com/microsoft/WSL/issues/5764#issuecomment-677868242