Configure a secondary private IPv4 address for your Windows instance - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Configure a secondary private IPv4 address for your Windows instance

You can specify multiple private IPv4 addresses for your instances. After you assign a secondary private IPv4 address to an instance, you must configure the operating system on the instance to recognize the secondary private IPv4 address.

Configuring the operating system on a Windows instance to recognize a secondary private IPv4 address requires the following:

Note

These instructions are based on Windows Server 2008 R2. The implementation of these steps may vary based on the operating system of the Windows instance.

Before you begin

As a best practice, launch your Windows instances using the latest AMIs. If you are using an older Windows AMI, ensure that it has the Microsoft hot fix referenced in http://support.microsoft.com/kb/2582281.

Prerequisite steps

  1. Assign the secondary private IPv4 address to the network interface for the instance. You can assign the secondary private IPv4 address when you launch the instance, or after the instance is running. For more information, see Assign a secondary private IPv4 address.

  2. Allocate an Elastic IP address and associate it with the secondary private IPv4 address. For more information, see Allocate an Elastic IP address and Associate an Elastic IP address with the secondary private IPv4 address.

Step 1: Configure static IP addressing on your instance

To enable your Windows instance to use multiple IP addresses, you must configure your instance to use static IP addressing rather than a DHCP server.

Important

When you configure static IP addressing on your instance, the IP address must match exactly what is shown in the console, CLI, or API. If you enter these IP addresses incorrectly, the instance could become unreachable.

To configure static IP addressing on a Windows instance
  1. Connect to your instance.

  2. Find the IP address, subnet mask, and default gateway addresses for the instance by performing the following steps:

    1. At a Command Prompt window, run the following command:

      ipconfig /all

      Review the following section in your output, and note the IPv4 Address, Subnet Mask, Default Gateway, and DNS Servers values for the network interface.

      Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Physical Address . . . . . . . . : DHCP Enabled. . . . . . . . . . . : Autoconfiguration Enabled . . . . : IPv4 Address. . . . . . . . . . . : 10.0.0.131 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 10.0.0.1 DNS Servers . . . . . . . . . . . : 10.1.1.10 10.1.1.20
  3. Open the Network and Sharing Center by running the following command:

    %SystemRoot%\system32\control.exe ncpa.cpl
  4. Open the context (right-click) menu for the network interface (Local Area Connection) and choose Properties.

  5. Choose Internet Protocol Version 4 (TCP/IPv4), Properties.

  6. In the Internet Protocol Version 4 (TCP/IPv4) Properties dialog box, choose Use the following IP address, enter the following values, and then choose OK.

    Field Value
    IP address The IPv4 address obtained in step 2 above.
    Subnet mask The subnet mask obtained in step 2 above.
    Default gateway The default gateway address obtained in step 2 above.
    Preferred DNS server The DNS server obtained in step 2 above.
    Alternate DNS server The alternate DNS server obtained in step 2 above. If an alternate DNS server was not listed, leave this field blank.
    Important

    If you set the IP address to any value other than the current IP address, you will lose connectivity to the instance.

    
							IP Addresses

You will lose RDP connectivity to the Windows instance for a few seconds while the instance converts from using DHCP to static addressing. The instance retains the same IP address information as before, but now this information is static and not managed by DHCP.

Step 2: Configure a secondary private IP address for your instance

After you have set up static IP addressing on your Windows instance, you are ready to prepare a second private IP address.

To configure a secondary IP address
  1. Open the Amazon EC2 console at https://console.amazonaws.cn/ec2/.

  2. In the navigation pane, choose Instances and select your instance.

  3. On the Networking, note the secondary IP address.

  4. Connect to your instance.

  5. On your Windows instance, choose Start, Control Panel.

  6. Choose Network and Internet, Network and Sharing Center.

  7. Select the network interface (Local Area Connection) and choose Properties.

  8. On the Local Area Connection Properties page, choose Internet Protocol Version 4 (TCP/IPv4), Properties, Advanced.

  9. Choose Add.

  10. In the TCP/IP Address dialog box, type the secondary private IP address for IP address. For Subnet mask, type the same subnet mask that you entered for the primary private IP address in Step 1: Configure static IP addressing on your instance, and then choose Add.

    
              TCP/IP Address dialog box
  11. Verify the IP address settings and choose OK.

    
              IP Settings tab
  12. Choose OK, Close.

  13. To confirm that the secondary IP address has been added to the operating system, at a command prompt, run the command ipconfig /all.

Step 3: Configure applications to Use the secondary private IP address

You can configure any applications to use the secondary private IP address. For example, if your instance is running a website on IIS, you can configure IIS to use the secondary private IP address.

To configure IIS to use the secondary private IP address
  1. Connect to your instance.

  2. Open Internet Information Services (IIS) Manager.

  3. In the Connections pane, expand Sites.

  4. Open the context (right-click) menu for your website and choose Edit Bindings.

  5. In the Site Bindings dialog box, for Type, choose http, Edit.

  6. In the Edit Site Binding dialog box, for IP address, select the secondary private IP address. (By default, each website accepts HTTP requests from all IP addresses.)

    
							IP Addresses
  7. Choose OK, Close.