我在 AWS 上托管的 Ubuntu 22.04 服务器上有两个接口。两者都有公共 IP 地址,但只有 ens5 响应传入流量。当我在 ens5 上运行 tcpdump 时,我可以看到我的 ping 请求到达了接口,但没有发送回复。我实际上需要在同一个子网中添加另外两个具有公共 IP 地址的接口,但我对 netplan 感到很困惑。任何建议都将不胜感激。
配置
network:
ethernets:
ens5:
dhcp4: false
dhcp6: false
addresses:
- 10.50.0.34/24
routes:
- to: default
via: 10.50.0.1
nameservers:
addresses: [8.8.8.8]
ens6:
dhcp4: false
dhcp6: false
addresses:
- 10.50.0.225/24
version: 2
IP 路由详细信息
default via 10.50.0.1 dev ens5 proto static
10.50.0.0/24 dev ens6 proto kernel scope link src 10.50.0.225
10.50.0.0/24 dev ens5 proto kernel scope link src 10.50.0.34
ip a 详细信息
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 02:91:f4:8f:d1:76 brd ff:ff:ff:ff:ff:ff
altname enp0s5
inet 10.50.0.34/24 brd 10.50.0.255 scope global ens5
valid_lft forever preferred_lft forever
inet6 fe80::91:f4ff:fe8f:d176/64 scope link
valid_lft forever preferred_lft forever
3: ens6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 02:87:1d:02:5c:c6 brd ff:ff:ff:ff:ff:ff
altname enp0s6
inet 10.50.0.225/24 brd 10.50.0.255 scope global ens6
valid_lft forever preferred_lft forever
inet6 fe80::87:1dff:fe02:5cc6/64 scope link
valid_lft forever preferred_lft forever