Reassign a private IP address in AWS?

I have an AWS instance running over elastic IP. The instance also has a private IP address in my VPC. I will reset the elastic IP to another instance and try to reassign the private IP. Note that the instance has only one private IP address (no secondary, etc.).

Is it possible?

+7
amazon-web-services amazon-ec2 ip
source share
2 answers

If this is not a "secondary private IP address" (and you said that it is not), then no, you cannot:

You can assign additional private IP addresses, known as secondary private IP addresses, to instances running in VPC. Unlike the primary private IP address, you can reassign the secondary private IP address from one network interface to another . For more information about primary and secondary IP addresses, see several IP addresses in the Amazon EC2 Linux Instances User Guide.

http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-ip-addressing.html

+10
source share

If you have an existing instance with the desired IP address (EXAMPLE: 10.0.0.101). You must take an image (AMI) and then complete this instance. Since it is in the VPC, just stopping it, it will not release the private IP.

Once you have a good image, complete it. This will free up his private IP address. This way you will have (10.0.0.101) available

Then assign the secondary private IP your new instance that you want and specify the private IP as the one you want (10.0.0.101)


To assign a secondary private IP to an existing instance

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

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

Select "Actions" and then "Manage Private IP Addresses".

In the Manage Private IP Addresses dialog box, do the following:

Select Assign New IP Address.

Enter a specific IP address within the subnet range for the instance or leave the field blank and we will select the IP address for you.

(Optional) Select "Allow reassignment" to allow reassignment of the secondary private IP address if it is already assigned to a different network interface.

Select Yes, Refresh, and then Close.

Note that as an alternative, you can assign a secondary private IP address to the instance. Select "Instances" in the navigation pane, select an instance, select "Actions", select "Network", and then "Manage Private IP Addresses". You can configure the same information in the dialog box as in the steps above.

+5
source share

All Articles