ESXI 上的嵌套客户虚拟机无法访问互联网,但可以访问主机

ESXI 上的嵌套客户虚拟机无法访问互联网,但可以访问主机

我在 ESXI 7.0 上运行 x86 Ubuntu 20(我们将其称为我的主机 VM)。在 Ubuntu VM 之上,我使用 QEMU 启动 ARM64 RaspiOS(这是我的客户 VM)。所以你可以说我有嵌套的 VM。

从我的主机(其静态 IP 为 10.105.226.235)我可以访问互联网,并且可以 ping 外部 DNS 服务器和 IP 为 10.105.226.233 的物理测试机。以下是我的主机接口。您可以看到我已设置桥接器br0tap0分接器接口。

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.105.226.235  netmask 255.255.0.0  broadcast 10.105.255.255
        inet6 fe80::20c:29ff:fe4b:7671  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:4b:76:71  txqueuelen 1000  (Ethernet)
        RX packets 1903892  bytes 1396076191 (1.3 GB)
        RX errors 0  dropped 9002  overruns 0  frame 0
        TX packets 646750  bytes 62291464 (62.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 00:0c:29:4b:76:71  txqueuelen 1000  (Ethernet)
        RX packets 8095571  bytes 10049111257 (10.0 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3854356  bytes 269349233 (269.3 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 59808  bytes 4751233 (4.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 59808  bytes 4751233 (4.7 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tap0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet6 fe80::249d:9cff:fe6e:55d8  prefixlen 64  scopeid 0x20<link>
        ether 26:9d:9c:6e:55:d8  txqueuelen 1000  (Ethernet)
        RX packets 12437  bytes 1336737 (1.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 74581  bytes 16655854 (16.6 MB)
        TX errors 0  dropped 1 overruns 0  carrier 0  collisions 0

从我的 ARM64 客户 qemu VM,我可以 ping 主机,但无法 ping DNS 服务器或 IP 为 10.105.226.233 的测试机器。如果这很重要,我在 ESXI 中启用了混杂模式。以下是我的界面在 qemu VM 中的样子。

pi@raspberrypi:~$ ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.105.226.232  netmask 255.255.255.0  broadcast 10.105.226.255
        ether 52:55:00:d1:55:01  txqueuelen 1000  (Ethernet)
        RX packets 120  bytes 8973 (8.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 50  bytes 5226 (5.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 25  bytes 2119 (2.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 25  bytes 2119 (2.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

pi@raspberrypi:~$ cat /etc/network/interfaces.d/eth0
auto eth0
iface eth0 inet static
  address 10.105.226.232
  netmask 255.255.255.0
  gateway 10.105.226.1
  dns-nameservers 68.152.128.40
  dns-nameservers 67.154.138.36

有人可以帮我一下如何从客户 QEMU VM 访问互联网和测试机器吗?

答案1

这是基于 ESXi 的嵌套虚拟化的预期行为。您需要在 vSwitch 上配置混杂模式,Ubuntu 使用该模式进行嵌套网络。https://kb.vmware.com/s/article/1002934

如何在交换机上配置混杂模式如下所述 -https://www.vmwareblog.org/build-home-lab-using-pc-part-1-2-setting-vmware-vsan-nested-esxi-hosts/

相关内容