0

I need help with my AWS EC2 Instance. I had one public IP on it, and it worked great. But now I need a second public IP, and for that I activated a Elastic IP and assigned it to the Instance over the AWS dashboard. My server is a Ubuntu 16.04. But I do not see the new IP in my Instance over the command line. What do I need to do?

Thank you!

eragon-2006
  • 117
  • 3

1 Answers1

0

Please check out this AWS Documentation for managing multiple ip.

Relevant part is that you need to assign a secondary private ip to your istance and then you can add a second elastic ip.

To assign a secondary private IPv4 address to a network interface

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

address for you.

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

another network interface.

Choose Yes, Update.

Then

To associate an Elastic IP address with a secondary private IPv4 address in EC2-VPC

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.

I try to avoid the need of more public ip on a single server and looks like AWS thinks that having "elastic ip" is generally not needed as you have just 5 of them by default unless you ask for more.

Federico Galli
  • 908
  • 6
  • 16
  • I already did all that stuff, but I do not see the IP inside the virtual machine with for example "ip addr show". – eragon-2006 Oct 19 '17 at 12:41
  • I just did that "stuff" too, and it works. Create a new interface and assign it to an ec2 instance. after few seconds you will see it with ip addr show. Then go under elastic ip, allocate a new ip, select the instance second eth and you are done. Super easy. – Federico Galli Oct 19 '17 at 13:16
  • In addition to the steps above, Ubuntu EC2 instances will also need some configuration as per this KB document: [adding a secondary network interface to Ubuntu](https://aws.amazon.com/premiumsupport/knowledge-center/ec2-ubuntu-secondary-network-interface/). – alexkb Jan 31 '19 at 07:17