Forum Discussion
Bala Sundaram
Sep 24, 2018Brass Contributor
Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
Can one confirm IP address range changed to 192.168.X.Y Subnet 255.255.255.240 from 172.X.X.X Also changes the subnet randomly on every Hyper-V services startup. 192.168.X.Y . X can change from 5...
Bala Sundaram
Dec 06, 2018Brass Contributor
Are you sure that in your particular case the class B vs. class C assignment isn't based simply on the type of switch (Default, External, Internal, and Private)?
cbj4074, I have no idea how iP is getting assigned. 17763.104 was bad, 17763.164 seems to atleast stick to Class D. I have stopped/started , rebooted at least dozen times and confirming.
cbj4074, I have no idea how iP is getting assigned. 17763.104 was bad, 17763.164 seems to atleast stick to Class D. I have stopped/started , rebooted at least dozen times and confirming.
cbj4074
Dec 10, 2018Brass Contributor
Thanks again for sharing your observations Bala Sundaram .
I can confirm that the switch type does not determine assigned IP address class, as you suggest. Indeed, when using the Default Switch, my colleagues and I receive a mix of 192 and 172 addresses if we provision VMs repeatedly.
To work around this, we've had to implement scripts that run at the end of the provisioning process, within the VMs, to detect and set the IPv4 and gateway addresses statically.
If there's any upside to the Hyper-V Switch behavior, it's that once a static IP is hard-coded within the VM, Hyper-V seems happy to issue it to the client whenever the VM is powered-on.
That said, I have not tried rebooting the host machine, starting/stopping the Hyper-V service, etc. between VM boots to see if that behavior remains consistent...
- Remon liDec 31, 2018Copper Contributor
Acturally, it will change to 192.168.x.x after several more rebooting.
- cbj4074Dec 31, 2018Brass Contributor
As a concrete example, the Default Switch in Hyper-V assigns 172.17.123.149 upon initial VM provisioning, and then I reboot and the address changes to 172.18.63.196. (At least it's not 192.168.x.x! That happens some portion of the time, too!)
As far as I'm aware, there is no means by which to configure this IP address range.
Even the folks working for HashiCorp's Vagrant can't figure out how to nail-down a static IP address in Hyper-V; see: https://github.com/hashicorp/vagrant/issues/8384 . If they can't figure it out, the rest of us are hopelessly lost...
- cbj4074Dec 31, 2018Brass Contributor
And that's precisely why this behavior is so annoying.
Even though I'm hard-coding a static IP in the VM during provisioning (based upon the dynamic IP that Hyper-V assigns via the Default Switch), as soon as I restart the host machine, the IP address class/range may very well change, which makes the VM network configuration inoperable.
To be clear, hard-coding a static IP in the VM is not a problem, as long as the Default Switch in Hyper-V doesn't change the IP address class. But when the guest IP address's first three octets are changing on every host machine reboot, there is simply no reliable means by which to configure a guest VM to use a static IP address. Assigning a static IP during provisioning is a trivial matter in every other virtualization solution! The fact that it's impossible in Hyper-V is bewildering.
Is anybody aware of an official "issue" / "bug report" that documents the behavior we're discussing in this thread?
- kazuo_yamauchiDec 18, 2018Brass Contributor17763.194 has same issue.According to the Microsoft-Windows-Hyper-V-VmSwitch/Operations log, it shows that the Default Switch is recreated each time the machine is booted.
(When started in safe mode with networking, it is not recreated, so it remains on the same subnet as last normal boot.) - Remon liDec 12, 2018Copper Contributor
Any news on 17763.194 ?
- Bala SundaramDec 11, 2018Brass Contributor
I am glad you got it sorted out. Pretty cool.
BTW...Regarding your comment "I can confirm that the switch type does not determine assigned IP address class, as you suggest"
One needs to be on Insider Build 17763.168 to get consistent CLASS D IP address on Hyper-V Stop/Starts. Sorry do not know the build number for W2K16 which I am told is also based on same code path of Windows 10K.
Regards,
Bala