Skip to content

How do I assign a secondary private IPv4 address to my EC2 Windows instance?

2 minute read
0

I want to assign an additional private IPv4 address to my Amazon Elastic Compute Cloud (Amazon EC2) Windows instance.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

To implement high-availability solutions, you can assign a secondary private IPv4 address to your Amazon EC2 Windows instance.

Complete the following steps:

  1. Assign the secondary IPv4 address to your instance when you launch your instance or after you launch your instance.
  2. To use multiple IP addresses in your instance, configure your instance to use static IP addressing instead of a DHCP server. When the instance converts from DHCP to static addressing, you lose Remote Desktop Protocol (RDP) connectivity to the Windows instance for a few seconds.
    Note: When you configure static IP addressing in your instance, the IP address must match what you see in the console, AWS CLI, or API. If you enter these IP addresses incorrectly, then the instance might become unreachable.
  3. Configure a secondary private IP address for your instance.
  4. (Optional) To add more than two DNS servers, choose DNS, enter the DNS server address, and then choose Add.
    Note: For information about reserved addresses, see Subnet sizing for IPv6.
  5. (Optional) If you need a public IP address with your secondary private IP address, then you can allocate and associate an Elastic IP address with your new secondary private IP address. When you associate the Elastic IP address, select the private IP address that you want to associate the Elastic IP address with.
  6. To confirm that the secondary IP address is added to the operating system, run the following PowerShell command:
    ipconfig /all

Related information

Configure secondary private IPv4 addresses for Windows instances

Elastic network interfaces

How do I associate a static public IP address with my EC2 Windows or Linux instance or network interface?

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

AWS OFFICIALUpdated 6 months ago