Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1

Brass Contributor

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 51 thru 180.

 

Although this is working on DHCP based IP assignment on guests, It is causing issues on static IP as it keeps changing after every boot

 

Regards,

Bala

135 Replies

It appears to be very random.

 

Default switch again reverted back to 172.17.X.X .

 

Strange.

Yes, I got same problem and can not find any answers to get a fixed ip for default switch.

Take a look at your Default Switch in Virtual Switch Manager, is it set to "External Network" with a defined controller or is it set to "Internal Network"?

Erratic IP address assignment issue is fixed in Build 17763. 134.

I am bit confused about the last post about checking in the VSM for External/Internal network that is association. We are talking about Default Switch supplied by MS for NATing from Configuration version >7.0. MS easy way of old fashioned internet connection sharing. It is always EXTERNAL. I am sorry not able to make any sense. We are not taking about a custom Switch that is associated with any network type (External/Internal/Private)

@Bala Sundaram is correct in that the Connection type cannot be changed for the Default Switch (all of the options are grayed-out), @H3ALY , even with all VMs powered-off.

 

In any case, I have the same problem/question as @Remon li . All I'm trying to do is assign a static IP address to a guest VM so that it doesn't change on me unexpectedly. I'd really like to satisfy the following requirements:

 

  1. Be able to specify the IP address to be used in the guest VM, e.g., 192.168.10.10.
  2. Be able to accomplish the above programatically, so that it can be done as part of an automated provisioning process (e.g., via Vagrant).
  3. Give Internet access to the guest VM via NAT (exactly as is done with the Default Switch). To be clear, I am amenable to using the Default Switch (instead of creating a new one), as long as its IP address does not change on me.

 

It sounds as though this is a two-part problem, and the first part is fixed in Build 17763.134, so at least the subnet will no longer change at random.

 

@Bala Sundaram , when you say, "Erratic IP address assignment issue is fixed in Build 17763. 134", how many of the four octets are now "fixed"? The first three? In other words, do you now find that the address is predictably set to 192.168.XX, where XX never changes unexpectedly (nor the 192.168 part)?

 

Thanks for any clarification that you're able to provide!

 

Hello cbj4074,

 

I do not know why I said something very wrong. Sorry for misleading. I checked again, It appears the unpredictable IP address on default switch issue exists in build 17763.104 too. Darn thing assigns CLASS C (172.17.239.XXX) or CLASS D (192.168.75.XXX). It is still unmanegable. May be I was clouded by the workaround I had in place. 

 

Basically I created a work around to take advantage of default switch as my two Physical NICs are teamed and fault tolerant.

 

  1. Created an Internal Switch
  2. Also have default switch that piles up on the bridged NIC (ICS)
  3. Have to VNIC's on the guest.
    1. Internal Switch based NIC is Static 192.168.5.XXX (255.255.255.0) for guest to guest communication.
    2. Default switch based NIC is Dynamic for Internet access

Regards,

Bala

 

17763.168 released , is it fixed or not ?

Took it down 17763.168 last night and was hoping it will be corrected. Confirming still has same issue and default switch is unmanagable exactly like ICS definition.

Only new thing it is assigning only class D Network ip address.

First two octet seems stabilized. 192.168.XXX.YYY. can change on every Hyper-V service start/stop
Bad news. I'm afraid develop team take it as new featuer instead of bug.

Too bad it is a pretty cool feature that is not working as we want. May be the development team has other ideas I suppose. As this is an ICS based knock off functionality, I am not surprised. ICS behaves exactly the same and unmanageable too.

No problem at all, @Bala Sundaram . I really appreciate the info you've shared thus far, and thank you for clarifying your observations.

 

In Hyper-V on the mainline Enterprise branch (Build 1803 17134.345), I've only ever seen the Default Switch assign a Class B address in the 172.X.X.X range, and the last three octets seem variable.

 

Although, when I create a new External Switch (haven't tried the other types), it is assigned a Class C address in the 192.X.X.X range.

 

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)?

 

In any case, until there is some simple means by which to set these values statically, this behavior is going to be problematic for automation, period. :(

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.

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...

@cbj4074 

 

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

17763.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.)

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?

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...

Acturally, it will change to 192.168.x.x after several more rebooting.