将多个私有IP和公共IP添加到AWS实例

时间:2019-04-25 11:27:50

标签: amazon-web-services networking network-interface

我产生了一个具有单个网络接口的AWS实例(Ubuntu)。 我已经附加了两个弹性IP和两个私有IP。

主要私有IP 172.30.175.22

次要私有IP 172.30.175.23

在附加了辅助IP之后,我执行了以下命令: sudo ip addr add 172.30.175.23/19 dev eth0

我想知道是否需要使用eth0:0而不是eth0

sudo ip addr的输出如下:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
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: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc pfifo_fast state UP group default qlen 1000
link/ether 02:1e:a3:64:25:4a brd ff:ff:ff:ff:ff:ff
inet 172.30.175.22/19 brd 172.30.191.255 scope global eth0
   valid_lft forever preferred_lft forever
inet 172.30.175.23/19 scope global secondary eth0
   valid_lft forever preferred_lft forever
inet6 fe80::1e:a3ff:fe64:254a/64 scope link
   valid_lft forever preferred_lft forever

但是ifconfig没有显示辅助IP:

eth0      Link encap:Ethernet  HWaddr 02:1e:a3:64:25:4a
      inet addr:172.30.175.22  Bcast:172.30.191.255  Mask:255.255.224.0
      inet6 addr: fe80::1e:a3ff:fe64:254a/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:9001  Metric:1
      RX packets:298149 errors:0 dropped:0 overruns:0 frame:0
      TX packets:384179 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:535085145 (535.0 MB)  TX bytes:46572724 (46.5 MB)

我是否正确完成或当前设置正确。我需要澄清。

0 个答案:

没有答案