我需要有关我的 AWS EC2 实例的帮助。我有一个公共 IP,它运行良好。但现在我需要第二个公共 IP,为此我激活了一个弹性 IP 并通过 AWS 仪表板将其分配给实例。我的服务器是 Ubuntu 16.04。但我没有通过命令行在我的实例中看到新 IP。我需要做什么?
谢谢你!
答案1
请查看此AWS 文档用于管理多个ip。
相关部分是您需要为您的实例分配一个辅助私有 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 个,除非你要求更多。