【发布时间】:2019-11-30 02:48:12
【问题描述】:
我在 Azure 中有一个带有 Ubuntu 19.04 和 4 个 NIC 的 VM,每个都有一个公共 IP,例如,这是第二个 NIC:
如您所见,它的公共 IP 为 191.234.186.19。
我的目标是能够从每个具有不同 IP 地址的 NIC 访问 Internet,但在 VM 内部,我只能使用第一个网络 eth0 访问它。
看着# route -n我得到这个输出:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.0.1 0.0.0.0 UG 100 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
168.63.129.16 10.0.0.1 255.255.255.255 UGH 100 0 0 eth0
169.254.169.254 10.0.0.1 255.255.255.255 UGH 100 0 0 eth0
我尝试使用以下命令为其他网卡添加路由:
sudo ip route add default via 10.0.0.1 dev eth1 metric 101
sudo ip route add default via 10.0.0.1 dev eth2 metric 102
sudo ip route add default via 10.0.0.1 dev eth3 metric 103
但我仍然无法使用这些 NIC 连接到互联网,只有 eth0。
我错过了什么吗?我是否需要更改/配置其他任何内容才能使其正常工作?
为了完整起见,我使用这个命令来测试连接性:
curl --interface eth1 api.ipify.org?format=json -w "\n"
而我的VM和本文中的一样:article
【问题讨论】:
标签: azure networking nic