Forum Discussion
Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
Is the default switch's crazy behavior of re-creating its vEthernet adapter on every reboot fixed in 1909 (or later)?
Nope,
if you need to use the default switch you can create your own persistent route from the powershell.
what is actually crazy is that when someone decides to setup servers and then use the default switch for that server, after that complain why the default switch gets a new IP address after each reboot!!!
Microsoft never designed the default switch for long term usage or advanced usage like on a virtual server (VM). the default switch, as the name applies, is just a set up and forget virtual network adapter, made by Default, for Anyone without Any networking experience, to setup a quick VM using the quick VM creation in Hyper-V.
Any serious server admin knows Not to use the default switch for any server.
I don't know why some people fail to understand this.
Default switch changes IP address after every reboot because it is Smart, it evaluates the network environment and chooses a free and routable temporary IP address for the user to use it on their VM.
a user that doesn't need or doesn't know how to go through more advanced setups like External virtual network adapter.
- HotCakeXOct 05, 2019MVPI don't think it's a bug in the first place
- HotCakeXOct 05, 2019MVPDefault switch is not to be used for advanced VMs where static IP address is required.
default switch was introduced only recently. what do you think people used to do All those Years then? default switch was added for one purpose and I mentioned what it is. - sn00pOct 05, 2019Copper ContributorI already have workarounds for that, np. The question was that the default switch for some reason is hardly usable in any scenario. It's not deletable, not configurable, not documented and changes it's own IP (as well as VM IP) address randomly. You can't use it outside of the very simple case - to have some simple internet inside VM for one session. In most scenarious it's just not enough no matter how skilled you are. Also it breaks other functionality like firewalls, access list, shared folders, streaming, NAT and all services inside VM which wants static address. And it means that any configuration is not reproducible and can't persist after a reboot. Every reboot you have to reconfigure VM services over and over. It's not the way software works in human world, it's just quirky MS implementation. And you have to pay for that's sad. I quit because it's not a discussion but more religious talk I guess.
DIXI - HotCakeXOct 05, 2019MVPAlso there is another way,
none of these is for people looking for easy networking but if you insist on using something that is made by default for people with little to no networking experience, then here it goes:
write a script, save it as a .bat file and the script should take the network adapter name and set it as private, use the Windows task scheduler to make it run at every startup. - HotCakeXOct 05, 2019MVP
You don't wanna use other types of adapters so I said alright, if you want, here is the way.
if you use the group policy to change the network location for all known and unknown networks, meaning any future networks that appear will have the private location.if you simply looked at my previous comments in the thread, you would know that it's not my way of thinking but many other people's. those links I mentioned are barely even 1%, there are lots of other proofs I can mention.
- DanielNiccoliOct 05, 2019Iron Contributor
"set the default network location for all known and uknown networks in Group Policy to private, no problem"
What happened with your previous statement "It's for easy networking and quick VM creation"? Editing group policies is not quick and easy.
"computers on a network using DHCP do NOT change their network locations when the DHCP server gives them a different IP address."
They do when the new IP address is in a different subnet.
And stop assuming that your way of working with Hyper-V is the only truth.
- HotCakeXOct 05, 2019MVP
Nope,
attach your VM to the virtual network adapter, no problem, set the virtual network adapter Inside the VM to private, no problem, set the default network location for all known and unknown networks in Group Policy to private, no problem.
instead of talking about imaginary things about me, please stay on topic and Don't be rude.
so again,
1. use group policy, the local one, not the group policy management, to change network locations.
2. if you change the virtual network adapter INSIDE the VM, it WON'T change after reboot of the host.
computers on a network using DHCP do NOT change their network locations when the DHCP server gives them a different IP address. - DanielNiccoliOct 05, 2019Iron Contributor
HotCakeX How is it "advanced networking" if I just wanna attach a computer to a network, but need it to be designated a private network so the firewall just works.
At this point you're just defending your own point of view. You can't make a statement anymore where you don't feel personally attacked. It's become very tedious. Just let go.
- HotCakeXOct 05, 2019MVPIt's for easy networking and quick VM creation, anything in particular and more advanced feature you need you have to use other types of virtual network adapters.
- HotCakeXOct 05, 2019MVPNot me.
you talked about another subject so I tried to stick to the topic and do not deviate. if you wanna talk about other subject you can open another topic. - DanielNiccoliOct 05, 2019Iron ContributorIt's also annoying that you have to switch your network from public to private every time the IP range changes for no reason.
A fixed range that changes only if there's a collision with the host's network would be enough. There is absolutely no need to randomize the IP range every time the host reboots. - sn00pOct 04, 2019Copper ContributorWell. HyperV doesn't have innate shared folders. Would you be so kind as to describe a procedure for sharing folders with Linux VM on the default switch?
It's not possible in the current implementation. There are hundreds of details you didn't take into account saying
"Default switch is usable in Every scenario except those that require static IP addresses such as servers".
It's not true, you can't even share folders. You can't use firewalls, you can't use ACLS or another wide used technics. It requires different third party software (all premium) and hours of configuring to be usable. Just compare it to simple two clicks in virtualbox before advocating weird and buggy MS implementation of the simplest thing ever widely available in every other similar software. - HotCakeXOct 04, 2019MVPThe reality is something else, I'm sorry that you feel it's a bug but the fact is different. you're free to have your opinion.
Default switch is usable in Every scenario except those that require static IP addresses such as servers.
the majority of the computer users/home users in the world use dynamic IP address, ISPs all around the world give their subscribers dynamic IP addresses, they only lease static IP address only to those clients that pay more and explicitly ask for it.
there is no win or loss, it's not a race, the correct way is shown, now if someone decides to go the wrong way, then it's their fault. - sn00pOct 04, 2019Copper Contributor
HotCakeX It's not a documentation. It's just a tech blogs with workarounds for an extremely buggy software.
The default switch is not usable in almost every scenario except 2 minutes demo session and I bet it could fail even in this case.
It's like a car moving randomly in every direction possible no matter the actual driver wants to drive.
And the thing that you have to add more objects to make it works doesn't make it a feature, it's still a bug. And even more, it's completely undeletable.
Please try Linux or simply VirtualBox so you could compare a MS mess and working solution from other vendors. Few hours for MS to make it work and few clicks on VB or few lines of configuration on Linux really makes a difference and MS is not a winner here. - HotCakeXOct 04, 2019MVP
you said stop speaking for MS (Microsoft),
ok sure, of course, why not.
here is what Microsoft says, Not me:
Hyper-V has a Default Switch for easy networking
Does a professional user who wants to setup a Virtual Server for serious work use something that is made for easy network? if he/she does then he/she is No longer called professional, but amateur. and for amateurs, Microsoft created the Default switch.
- mlmathewsOct 04, 2019Brass ContributorTrue, but I have to re-disable it after every boot.
- HotCakeXOct 04, 2019MVP
Previously you had to mess around using virtual switch manager to create a connection to network. Now you just select default switch if you like.
This option is essential for quick creating a new hyper-v session.
It is only used in existing sessions if you explicitly add it to a particular VM session.
Deleting it will not provide any additional security, or prevent other users creating a virtual switch.
Deleting things without understanding their functionality is surefire way to break things!the 2nd comment
- HotCakeXOct 04, 2019MVP
mlmathews wrote:
Yeah, I'd be fine if I could just remove the default. It's a real headache when I need to connect my work laptop to the corporate network. I can't get on the corporate WLAN if there are any other unauthenticated adapter connections...and the vEthernet adapter is not authenticated. I know a registry hack to get around this issue...but the dang vEthernet adapter gets recreated on every boot and I have to re-apply the hack. I could write a script to do it, but its madness that I can't just get rid of the thing.You can disable it from the network settings or device manager.
- HotCakeXOct 04, 2019MVP
“Hyper-V has a Default Switch for easy networking.” Having just tried it out myself, I can affirm that this Default Switch makes Hyper-V networking dead simple.
if you don't believe me, I can give you thousands of guides and YouTube videos to show everyone setting up a virtual servers uses External/Internal/Private network adapters, Not the default one.
- sn00pOct 04, 2019Copper Contributor
HotCakeX
Please stop speaking for MS, it is stated nowhere that
Microsoft never designed the default switch for long term usage or advanced usage like on a virtual server (VM)The documentation said nothing about it. I've spent hours just to figure out that it's simply broken.
Any serious server admin knows Not to use the default switch for any server.
It's not true again. You could use any default switch from every other software vendor except MS no matter are you serious or not.
Why don't you just understand that it's not a feature, it's a bug, nobody doing this stuff except MS. Nobody period. - mlmathewsOct 04, 2019Brass ContributorYeah, I'd be fine if I could just remove the default. It's a real headache when I need to connect my work laptop to the corporate network. I can't get on the corporate WLAN if there are any other unauthenticated adapter connections...and the vEthernet adapter is not authenticated. I know a registry hack to get around this issue...but the dang vEthernet adapter gets recreated on every boot and I have to re-apply the hack. I could write a script to do it, but its madness that I can't just get rid of the thing.
- HotCakeXOct 04, 2019MVPWho said they don't want you to use the default switch?
read my post again, it's for people who don't know much about networking so Hyper-V creates a pre-made virtual network adapter called default switch for them to help get internet connection on their VM.
people might be behind multiple NATs, different subnets and have multiple NICs, default switch is Smart so it identifies the difficulties of the network and creates a non-persistent route for the moment to give that user an Internet connection at any cost. the reason it chooses a non-persistent route is to Reevaluate the network environment for any changes. the random addresses gives it flexibility.
if the default switch is bugging you then you're doing it Wrong.
you're probably relying on an static IP address and instead of doing the proper and correct work of creating an external network adapter, you just used the default switch.
that's Not the right way.
this is something that I use for work and personal everyday and I've worked with lots of other professionals either IRL or collaborated over the Internet, Learned from them and experienced myself, nobody, I say again, Nobody chooses the default switch for a Virtual Server that needs a static IP address.
you can't do something wrong, get a bad result and then say it's a bug....