我在从运行 Ubuntu 的 Proxmox 虚拟机与不同 VLAN 上的 NSA 进行通信时遇到问题。此问题仅发生在该特定虚拟机上。我在同一个机器上还有其他虚拟机,可以很好地 ping 通其他 VLN。我注意到一件奇怪的事情是,当我尝试 ping NAS 时,“发件人”IP 地址不正确:
PING 192.168.30.17 (192.168.30.17) 56(84) bytes of data.
From 192.168.16.1 icmp_seq=1 Destination Host Unreachable
From 192.168.16.1 icmp_seq=2 Destination Host Unreachable
192.168.16.1不是虚拟机的IP。这是我的 ifconfig:
br-bdc324865e7c: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.16.1 netmask 255.255.240.0 broadcast 192.168.31.255
ether 02:42:05:de:59:9f txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-e6ff6afcb423: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.22.0.1 netmask 255.255.0.0 broadcast 172.22.255.255
inet6 fe80::42:1fff:fe6e:32bf prefixlen 64 scopeid 0x20<link>
ether 02:42:1f:6e:32:bf txqueuelen 0 (Ethernet)
RX packets 664 bytes 2500219 (2.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 582 bytes 106273 (106.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-ea68e1731716: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255
ether 02:42:2d:22:ff:68 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-ee877fa76586: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.31.0.1 netmask 255.255.0.0 broadcast 172.31.255.255
ether 02:42:39:6f:43:d0 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
br-fd077aeb7a68: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.30.0.1 netmask 255.255.0.0 broadcast 172.30.255.255
ether 02:42:fc:7f:81:b1 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:ffff:fe62:814 prefixlen 64 scopeid 0x20<link>
ether 02:42:ff:62:08:14 txqueuelen 0 (Ethernet)
RX packets 8251 bytes 17989335 (17.9 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 8149 bytes 5781191 (5.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens18: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.123 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::84e1:2aff:fefb:8b37 prefixlen 64 scopeid 0x20<link>
ether 86:e1:2a:fb:8b:37 txqueuelen 1000 (Ethernet)
RX packets 32519 bytes 11182404 (11.1 MB)
RX errors 0 dropped 2277 overruns 0 frame 0
TX packets 12508 bytes 23008661 (23.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
正如您所看到的,我在此虚拟机上运行 docker,因此还有许多其他接口,包括 192.168.16.1。为什么该接口在那里,为什么使用它来 ping NAS?
答案1
事实证明 docker compose 正在创建糟糕的网络。我不知道为什么或如何开始这样做,但删除它后一切又恢复了。