I want to assign a custom primary private IP address to my Amazon Elastic Compute Cloud (Amazon EC2) instance.
Short description
You can associate a custom private IP address to your Amazon EC2 instance while you configure the instance before you launch it. However, the IP address must meet these conditions:
- Have a valid IPv4 range.
- Be within the CIDR range of the chosen subnet.
- Be available. The private IP address must not be tied to any other resource.
Note: It's not possible to assign a new custom primary private IP address to an existing instance.
Resolution
- Configure an Amazon EC2 instance. For detailed steps, see Launch an instance using the old launch instance wizard or Launch an instance using the new launch instance wizard.
- In the Configure Instance Details section, for Network, select a virtual private cloud (VPC), or create a new VPC. For Subnet, select the subnet, or create a new subnet where you want to launch your instance.
- In the Network interfaces section, for Primary IP (the primary private IPv4 address of the network interface), enter the custom private IPv4 address.
- Complete the launch instance wizard configurations, and then launch the instance.
Related information
VPCs and subnets