大网数据广告活动
服务器运维问答

Hyper-V guest doesn't see the internet through external virtual switch

· 52CE 我爱测

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 th…

问题原文

原帖链接 · Csaba Toth · CC BY-SA 3.0

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

已采纳解答

原帖链接 · Csaba Toth · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-03-31)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。