How do I assign a custom primary private IP address to my EC2 instance?

2 minute read
1

I want to assign a custom primary private IP address to my Amazon Elastic Compute Cloud (Amazon EC2) instance.

Short description

Before you launch your Amazon EC2 instance, you can associate a custom private IP address with the instance during configuration. The IP address must meet the following requirements:

  • The IP address must have a valid IPv4 range.
  • The IP address must be within the CIDR range of the chosen subnet.
  • The IP address must be available. The private IP address must not be tied to any other resource.

Note: You can't assign a new custom primary private IP address to an existing instance.

Resolution

Complete the following steps:

  1. Configure your EC2 instance.
  2. In Network Settings, for VPC, select an existing virtual private cloud (VPC), or create a new VPC. For Subnet, select an existing subnet, or create a new subnet where you want to launch your instance.
  3. In Network interfaces, for Primary IP, enter the custom private IPv4 address.
    Note: The Primary IP is the primary private IPv4 address of the network interface for Device Index 0.
  4. Complete the launch instance wizard configurations, and then launch the instance.

Related information

VPCs and subnets

AWS OFFICIAL
AWS OFFICIALUpdated 6 days ago