Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In AWS is there a thing like a private elastic IP address?

I have an EC2 instance with a stateful service on it (think database). It has an explicitly set VPC-internal IP address which I am using in clients.

Now I would like to re-instance, reboot or otherwise perform maintenance on that instance without clients erroring out. I could spin up a second instance and point all clients to the new IP address, but this way I would still need to synchronise both instances until the last client switches over.

In AWS you can have elastic IP addresses. This allows you to switch the instance an IP is pointing to. Problem is those are public (reachable from the internet). I want a VPC-internal IP address I can re-assign between instances. Is there such a thing in AWS?

like image 988
Hubert Grzeskowiak Avatar asked Oct 25 '17 06:10

Hubert Grzeskowiak


People also ask

What is Private IP in AWS?

A private IPv4 address is an IP address that's not reachable over the Internet. You can use private IPv4 addresses for communication between instances in the same VPC. For more information about the standards and specifications of private IPv4 addresses, see RFC 1918 .

Is Elastic IP always public?

An Elastic IP address is a reserved public IP address that you can assign to any EC2 instance in a particular region, until you choose to release it.

How do I make my IP private on AWS?

From the Networking tab, Expand Network interfaces, and then choose the Interface ID. Select the Network interface ID, Choose Actions, and then choose Manage IP Addresses. The primary private IPv4 IP address is already listed. Expand the network interface ID, and then choose Assign new IP address.

What is AWS Elastic IP address?

An Elastic IP address is a static public IPv4 address associated with your AWS account in a specific Region. Unlike an auto-assigned public IP address, an Elastic IP address is preserved after you stop and start your instance in a virtual private cloud (VPC).


1 Answers

Yes, you can do it by attaching additional network interface(eth1)to the instance which will be assigned a private IP. During the maintenance of the instance, you can move the network interface to the new instance.

Link:docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html

like image 95
Naveen Kerati Avatar answered Nov 04 '22 04:11

Naveen Kerati