How do I configure a secondary private IPv4 address on my EC2 instance?
Last updated: 2021-07-13
I want to configure a secondary private IPv4 address on my Amazon Elastic Compute Cloud (Amazon EC2) instance. How do I do that?
You can assign a secondary private IPv4 address to an Amazon EC2 instance when you launch the instance. If you already launched the EC2 instance, then you can assign a secondary private IP address to the network interface.
- Assign the secondary IPv4 address to your instance.
- Configure the instance operating system to recognize the new IP address.
For Windows Server, see Configuring a secondary private IPv4 address for your Windows instance.
For Amazon Linux, see Configuring the operating system on your instance to recognize secondary private IPv4 addresses.
For other Linux distributions, see the network configuration documentation for your distribution. For example, for Ubuntu, see Network configuration on the Ubuntu website.
- (Optional) If you need a public IP, you can associate an Elastic IP address with your new secondary private IP address.
Note: If you have more than one Elastic IP address on an EC2 instance, charges apply. For instructions on releasing an Elastic IP address, see Release an Elastic IP address.