Skip to content

How do I configure a secondary private IPv4 address on my EC2 instance?

2 minute read
1

I want to configure a secondary private IPv4 address on my Amazon Elastic Compute Cloud (Amazon EC2) instance.

Resolution

You can assign a secondary private IPv4 address to an EC2 instance when you launch the instance.

If you already launched the instance, then you can assign a secondary private IP address to the elastic network interface. First, assign the secondary IPv4 address to your instance. Then, configure the instance operating system (OS) to recognize the new IP address. For Windows Server, see Configure secondary private IPv4 addresses for Windows instances.

For modern Linux distributions, NetworkManager or Netplan automatically recognize the secondary IPv4 address. See the following configuration information based on your Linux distribution:

If you need a public IP address for the secondary private IP address, then allocate an Elastic IP address. Then, associate the Elastic IP address with the secondary IP address.

Note: If you have more than one Elastic IP address on an instance, then charges apply. For instructions on how to release an Elastic IP address, see Disassociate an Elastic IP address and Release an Elastic IP address.

Related information

Multiple IP addresses

Connect your VPC to other networks

AWS OFFICIALUpdated 4 months ago