3

As we know, with Fall Creators update Microsoft added so-called Default Switch, an out-of-the-box type of switch which simplifies networking and combine features of internal and external switches.

How we can set up static IP for that switch to access the host via recognizable IP? Yes, I can check the Default Switch NIC IP on the host then paste it into Guest system and access host shares like this, but it's cumbersome because Default Switch IP changes each reboot.

Is there any way to make it static or any other reserved keyword or FQDN name with which we can access host?

EDIT: I do not really care if it is a routable or non-routable IP (as from enterprised1 comment), it should "just works" ©, i.e. to allow me access host shares and I will be happy.

Using a one switch instead of two (Default + External) is always more preferable.

Suncatcher
  • 552
  • 2
  • 7
  • 22

1 Answers1

3

If you want to control networking on Hyper-V, you should create an External Vitrtual Switch.

The Default Switch is to bring Hyper-V in line with VirtualBox and VMWare where you don't have to manually configure the network on your VMs.

Using an External Virtual Switch will allow you to assign a static IP to the VM.

  • Yes, I know that with DefSwitch I cannot assign static address to VM. But here I am speaking about IP-address **of switch**, not VM IP. Can we control it? I don't know how to set up IP for external switch either. Would be fine, if you shed light on this. – Suncatcher Feb 06 '18 at 13:11
  • Or is there any way to access host not by switch IP but by some reserved address (e.g. 127.0.0.1)? – Suncatcher Feb 06 '18 at 13:12
  • I don't believe the switch has an IP. If you're trying to access the host by a known IP, you can set a static IP on the host's network adapter. – enterprised1 Feb 07 '18 at 01:00
  • `I don't believe the switch has an IP` the switch [has an IP](https://imgur.com/a/YTqLn), IP of the NIC that is created during creation of a switch. And by this IP I can connect to my host shares from inside the guest VM. The problem is that this IP is dynamic. – Suncatcher Feb 07 '18 at 09:28
  • That IP is a non-routable Private IP address. The VMs on that host use NAT to communicate with the outside world. To accomplish what you want, the easiest way is to setup an External Switch and allow the VMs to get an IP on the same subnet your host uses from the DHCP server. I'm guessing your host machine is using a 192.168.x.x /28 IP address. Make sure the VM has an IP on the same subnet and you can connect using \\hostname\share – enterprised1 Feb 08 '18 at 10:11
  • Well, external switch works, but it seems that it's pretty unsafe to connect VMs to outer world via external switch. Does internal default switch more secure or no? – Suncatcher Feb 25 '18 at 10:17
  • 1
    Using an External switch is no less safe than connecting a device directly to your local network, so not clear on what you mean by unsafe. Internal switch is only for communication between host and virtual machine so if that's all you need, it'll work. However, if you need any kind of internet access on the VM, you can't use Internal switch. – enterprised1 Feb 26 '18 at 21:45