2

I have a Windows Server 2012 R2 Essentials host with 1 NIC and I installed a Hyper-V guest of the same type (Windows Server 2012 R2 Essentials). I added an external virtual switch (allowing management operating system to share this adapter) and the VM is connected to that. The guest doesn't indicate internet connection and when I try to repair it, the analysis concludes with a "Ethernet" doesn't have a valid IP configuration.

According to what I've read this should be enough for the VM to see the internet. The host computer has connection, I can browse the web.

Host:

Ethernet adapter vEthernet (Internal Virtual Switch):

Connection-specific DNS Suffix  . :
Link-local IPv6 Address . . . . . : fe80::f06b:9607:17f9:f2e8%37
Autoconfiguration IPv4 Address. . : 169.254.242.232
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :

Ethernet adapter vEthernet (External Virtual Switch):

Connection-specific DNS Suffix  . :
IPv6 Address. . . . . . . . . . . : 2602:304:791c:4270:3cfc:fd08:c467:3f3c
Link-local IPv6 Address . . . . . : fe80::3cfc:fd08:c467:3f3c%21
IPv4 Address. . . . . . . . . . . : 192.168.1.253
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : fe80::6655:b1ff:fe6d:a1f0%21
                                   192.168.1.254

Guest:

Ethernet adapter Ethernet:

Connection-specific DNS Suffix  . :
Link-local IPv6 Address . . . . . : fe80::2d32:ed0b:c32e:d13b%12
Autoconfiguration IPv4 Address. . : 169.254.209.59
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :

I also have some other devices (one tunnel on the guest) and a whole bunch on the host because I tried to go with Internal Virtual Switch by desperation, so I installed RRAS and configured VPN and DirectAccess to enable NAT. That didn't help either, but I need External Switch anyway, because I want to connect to the VM through RDP from home.

What am I doing wrong?


Update: according to the advice I configured the guest's NIC's IPv4 to:

IP 192.168.1.221
netmask 255.255.255.0
gw 192.168.1.254

It still doesn't see the net. ARP table on the host:

Interface: 127.0.0.1 --- 0x1
  Internet Address      Physical Address      Type
  224.0.0.22                                  static
  224.0.0.251                                 static
  224.0.0.252                                 static
  224.0.0.253                                 static
  232.242.254.169                             static
  239.255.255.250                             static

Interface: 192.168.1.253 --- 0x15
  Internet Address      Physical Address      Type
  169.254.242.232       00-00-00-00-00-00     invalid
  169.254.255.255       00-00-00-00-00-00     invalid
  192.168.1.221         00-00-00-00-00-00     invalid
  192.168.1.252         10-bf-48-7e-18-58     dynamic
  192.168.1.253         00-00-00-00-00-00     invalid
  192.168.1.254         64-55-b1-6d-a1-f0     dynamic
  192.168.1.255         ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.251           01-00-5e-00-00-fb     static
  224.0.0.252           01-00-5e-00-00-fc     static
  224.0.0.253           01-00-5e-00-00-fd     static
  232.242.254.169       01-00-5e-72-fe-a9     static
  239.255.255.250       01-00-5e-7f-ff-fa     static
  255.255.255.255       ff-ff-ff-ff-ff-ff     static
1
  • The Hyper-V host wouldn't normally have an ARP entry for the guest unless the Hyper-V host itself was communicating with the guest, which isn't the case for normal operations. Did you inadvertently assign 192.168.1.221 to another device on the network? Have you tried clearing the ARP cache on the Hyper-V host? What happens when you run tracert 8.8.8.8 from the guest?
    – joeqwerty
    Mar 31, 2016 at 4:09

3 Answers 3

3

The Hyper-V guest has the ip address 169.254.209.59. This is an APIPA address. It's only useful for communicating with other local devices that also have an APIPA address. You need to assign a valid ip address, subnet mask, default gateway and DNS servers to the guest.


I have no idea what you're saying or asking in your comments. The virtual switch has an ip address because you've configured it to be shared with the management operating system. This ip address is solely for the purpose of accessing the Hyper-V host itself. It has no bearing on your guest connectivity. You should assign an ip address to your guest just as you would a physical machine. If your network is 192.168.1.0/24 (or whatever) then you need to configure the guest with an ip address in that range just as you would a physical machine. The Hyper-V host is not a router, it does not perform NAT, and it has no involvement in moving traffic from the guest to the actual physical network other than being a physical "conduit" for that traffic.

11
  • Sometimes my VMs come up with an autoconfiguration address even though they have a static address assigned. I've searched around a lot for a solution and still haven't fully solved the problem. There is a workaround which is to go into the VM setting, set the adapter to no network and click apply, then set it to the correct network and click apply. Basically the virtual version of unplugging and replugging in the network cable. Mar 31, 2016 at 2:32
  • 169.254.x.x is the IP address range taken by the virtual switch. It's external virtual switch. As my understanding (correct me if I'm wrong) but only the host and the guest should see such packets and no other computers (there's no default gateway for this virtual switch interface on the host or the guest so those packets cannot leak out theoretically). In the end the packets will leave the host server through the interface which has the 192.168.1.253 IP, they go towards the 192.168.1.254 default gateway.
    – Csaba Toth
    Mar 31, 2016 at 3:05
  • If I'd set the IP address to something forcefully on the guest, wouldn't it collide with the virtual switch's network settings and netmask? Can I configure network attributes on the external switch somehow?
    – Csaba Toth
    Mar 31, 2016 at 3:10
  • See my edit....
    – joeqwerty
    Mar 31, 2016 at 3:29
  • So what IP address should I configure on the guest? I tried a public IP (spare), didn't work. I also tried an IP in the range what the host has it's interface on (192.168.1.x/24) but no luck so far. If I look at the host's ARP table, I see the IP what I assigned (192.168.1.221), but the entry says "invalid".
    – Csaba Toth
    Mar 31, 2016 at 3:40
1

It was the VLAN ID. If I recall it correctly, when you created the External Virtual Switch, the VLAN ID checkbox was disabled. When I added the VM to that External Switch, the VM was enabled and set to 2. I needed to uncheck that VLAN ID on the VM network settings, and that solved the problem, the ARP tables started to populate on both ends and the host and the guest can ping each other now. They are on the same subnet of course.

1

Csaba Toth is correct. To make it clearer - setting "WLAN ID" is present both in the Virtual Switch Manager and under Network Settings on the Hyper-V machine. BOTH must be unchecked.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .