Google Cloud 不会通过其他 NIC 进行路由

Google Cloud 不会通过其他 NIC 进行路由

我已经在 GCP 中部署了一个新的计算虚拟机,但无法弄清楚为什么附加 NIC(nic/eth1-nic/eth3)没有路由往返互联网的流量,但 eth0 工作正常。

GCP 网络接口配置

Linux 路由表:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         gateway         0.0.0.0         UG    100    0        0 eth0
10.228.0.0      gateway         255.255.255.248 UG    100    0        0 eth0
gateway         0.0.0.0         255.255.255.255 UH    100    0        0 eth0
cp1.us-central1 0.0.0.0         255.255.255.255 UH    100    0        0 eth0
10.230.0.0      10.230.0.1      255.255.255.248 UG    0      0        0 eth1
10.230.0.1      0.0.0.0         255.255.255.255 UH    0      0        0 eth1
10.232.0.0      10.232.0.1      255.255.255.248 UG    0      0        0 eth2
10.232.0.1      0.0.0.0         255.255.255.255 UH    0      0        0 eth2
10.234.0.0      10.234.0.1      255.255.255.248 UG    0      0        0 eth3
10.234.0.1      0.0.0.0         255.255.255.255 UH    0      0        0 eth3

如果我尝试通过 eth0 ping 互联网资源,它可以工作,但是对于 eth1-3 则不行。

[root@cp1 ~]# ping -I eth0 1.1.1.1
PING 1.1.1.1 (1.1.1.1) from 10.228.0.2 eth0: 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=54 time=13.2 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=54 time=12.5 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=54 time=13.4 ms
^C
--- 1.1.1.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 12.570/13.101/13.470/0.407 ms
[root@cp1 ~]# ping -I eth1 1.1.1.1
PING 1.1.1.1 (1.1.1.1) from 10.230.0.2 eth1: 56(84) bytes of data.
^C
--- 1.1.1.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 2999ms

我还检查了 GCP 防火墙并允许所有进出以进行故障排除。

任何帮助都值得感激。谢谢

答案1

因为您只有一条默认路由 - 通过 eth0。

从你发布的内容来看,其他接口没有公共路由,只有各种RFC1918-子网。

相关内容