我正尝试将次要内部IP与我的Amazon VPC小型机器相关联,我正在使用基于Ubuntu的AMI ID为ami-6936fb00的映像。 问题是,我无法弄清楚如何configuration我的操作系统(Ubuntu)来logging第二个私有IP地址(这是必需的,如AWS文档中所述: http : //docs.amazonwebservices.com/AWSEC2/latest/UserGuide /using-instance-addressing.html#using-instance-addressing-eips )!
我有一个单一的ENI,并有一个额外的私人IP与它相关联。
任何帮助,将不胜感激。
谢谢
您的/etc/network/interfaces文件可能具有以下内容:
auto eth0 iface eth0 inet static address 192.0.2.10 netmask 255.255.255.0 gateway 192.168.2.1
这是分配主IP(它也可能是DHCP)。 要分配一个辅助IP,添加一个附加的脚本来附加地址到eth0。
auto eth0 iface eth0 inet static address 192.0.2.10 netmask 255.255.255.0 gateway 192.168.2.1 up ip addr add 192.168.2.20/24 dev eth0
我终于能够弄清楚如何logging我的AWS VPC机器的第二个私有IP:我将其添加到/ etc / network / interfaces:
auto eth0:0 iface eth0:0 inet static address 192.xyz netmask 255.255.255.0
然后运行ifup eth0:0
我的ifconfig显示eth0和eth0:0与正确的私人IP地址。