User Profile
cbj4074
Brass Contributor
Joined 7 years ago
User Widgets
Recent Discussions
Re: Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
I realize that many of us have differing use-cases; some of us are software developers using Vagrant who want internal IP addresses, some of us are systems admins using Windows Server who want external IP addresses, and some of us are adamant about using the Default Switch whereas some of us don't care what switch we use as long as its IP address doesn't change. For those who share my specific use-case (i.e., using Vagrant and impartial to the Default Switch), I wrote a comprehensive How-To, which you may find helpful: https://superuser.com/a/1379582/176764 Hopefully, Vagrant and Microsoft can work together to eliminate all the hoop-jumping!10KViews1like5CommentsRe: Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
HotCakeX Thank you for replying; I appreciate it. I am using Windows 10 Version 1903, build 18362.329. I'm in no way married to the Default Switch and am perfectly content to create another switch for my purposes. I simply need to meet the conditions described in my previous post. The second configuration you suggest looks to be exactly what I want, and in fact, it's exactly what's described in the following blog post that mlmathews cited earlier in the thread: https://www.petri.com/using-nat-virtual-switch-hyper-v This configuration does in fact function exactly the way I'd like, so I'm happy! That said, I concur with mlmathews that the Default Switch poses an annoyance now, for one specific reason: when I provision a virtual machine with Vagrant, I'm prompted which switch to use, because I now have more than one, whereas when only one switch exists, Vagrant chooses the only switch automatically and without prompting. I've tried disabling the Default Switch in the Device Manager (which, of course, also causes it to be disabled in Control Panel\Network and Internet\Network Connections), but Vagrant still sees it as long as it's available in Hyper-V's Virtual Switch Manager. In any case, I can live with this minor annoyance, as well as the fact that the Virtual Switch, despite it's un-intuitive behavior, may be working exactly as Microsoft intends. Whether or not that behavior is ill-conceived, short-sighted, and completely out of lockstep with that seen in competing products is another discussion in which I have far less interest than "just getting it working". 😉 And if the information offered in https://mikefrobbins.com/2018/11/08/managing-the-hyper-v-default-switch-in-windows-10-version-1709-and-higher-with-powershell/ has not changed substantially since its publication, removing the Default Switch sounds to be more trouble than it's worth. Thanks again for all the help, everyone!10KViews1like7CommentsRe: Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
mlmathews It sounds as though our respective use-cases may be similar. (Edit to add: I had missed your most recent reply, as I failed to notice page 2; I will look into the PowerShell-based solution! Thank you!) I'm a web developer who works primarily with VMs running GNU/Linux. I work in a Windows-driven, corporate ecosystem, though, so my primary development machine runs Windows 10 with Hyper-V. I have many different VMs that I spin-up on a regular basis, oftentimes freshly-provisioned (that is, built dynamically and booted for the first time on each use). The provisioning process is 100% automated, which I mention only to make clear that there is no room for "manual tweaking" nor GUI configuration in my workflow; any networking configuration has to be automated during provisioning. Further, I have many VM configurations in which one VM needs to communicate with one or more other VMs on the same subnet, which requires that each source VM knows any potential destination VM's IP address (a hostname could work, too, if hostname resolution was configured correctly, which I haven't yet attempted with Hyper-V). More importantly, I need this subnet to be completely isolated from my physical NIC so that there is zero possibility of another machine on my LAN communicating with any of the VMs running in Hyper-V. But I also need for the VMs to be able to connect to the Internet. So, here's where I'm stuck: 1.) Default Switch: IP address assigned to VMs changes at random on host system reboot, so without hostname resolution across multiple VMs on VLAN, this configuration is untenable. 2.) External Network: This makes my VMs visible on our corporate LAN, which is a no-go. 3.) Internal Network: My VMs cannot obtain IPv4 addresses for some reason; only IPv6. No idea why this is. 4.) Private Network: Doesn't allow VMs access to internet, so not viable. HotCakeXDo you have a clever solution that will meet my requirements?15KViews0likes35CommentsRe: Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
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...118KViews1like1CommentRe: Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
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?118KViews2likes2CommentsRe: Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
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...119KViews1like6CommentsRe: Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
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. :(119KViews1like8CommentsRe: Hyper-V Default switch IP address range change. Ver 1809 Build 17763.1
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: Be able to specify the IP address to be used in the guest VM, e.g., 192.168.10.10. Be able to accomplish the above programatically, so that it can be done as part of an automated provisioning process (e.g., via Vagrant). 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!119KViews1like15Comments
Recent Blog Articles
No content to show