Ubuntu

aws 添加彈性 IP

  • October 19, 2017

我需要有關我的 AWS EC2 實例的幫助。我有一個公共 IP,效果很好。但現在我需要第二個公共 IP,為此我啟動了一個彈性 IP 並通過 AWS 儀表板將其分配給實例。我的伺服器是 Ubuntu 16.04。但是我沒有通過命令行在我的實例中看到新 IP。我需要做什麼?

謝謝!

請查看此AWS 文件以管理多個 ip。

相關部分是您需要為您的 istance 分配一個輔助私有 ip,然後您可以添加第二個彈性 ip。

將輔助私有 IPv4 地址分配給網路介面

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

In the navigation pane, choose Network Interfaces, and then select the network interface attached to the instance.

Choose Actions, Manage IP Addresses.

Under IPv4 Addresses, choose Assign new IP.

Enter a specific IPv4 address that's within the subnet range for the instance, or leave the field blank to let Amazon select an IP

地址給你。

(Optional) Choose Allow reassignment to allow the secondary private IP address to be reassigned if it is already assigned to

另一個網路介面。

Choose Yes, Update.

然後

將彈性 IP 地址與 EC2-VPC 中的輔助私有 IPv4 地址相關聯

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

In the navigation pane, choose Elastic IPs.

Choose Actions, and then select Associate address.

For Network interface, select the network interface, and then select the secondary IP address from the Private IP list.

Choose Associate.

我試圖避免在單個伺服器上需要更多公共 IP,並且看起來 AWS 認為通常不需要具有“彈性 ip”,因為預設情況下您只有 5 個,除非您要求更多。

引用自:https://serverfault.com/questions/879230