Do I need to set a static private IP address for an Amazon EC2 Windows instance?
Last updated: 2020-12-14
I use an Amazon Elastic Compute Cloud (Amazon EC2) Windows instance, and a private IP address is automatically assigned to the instance. Do I need to assign a static IP address to the instance?
In many cases, you don't need to set a static private IP address on am Amazon EC2 Windows instance. However, you might need to use two private IP addresses for your Windows network adapter. To assign a static private IP address for an Amazon EC2 Windows instance, follow these steps:
Note: The network interface IP address and Windows adapter IP addresses must match for a successful network connection.
- Open the Amazon EC2 console, and then choose Instances from the navigation pane.
- Select your instance. From the Description tab, choose the linked name next to Network interfaces, and then choose the Interface ID.
- Choose Actions, and then choose Manage IP Addresses. The primary private IPv4 IP address is already listed.
- Choose Assign new IP.
For Auto-assign, enter a new IP address, and then choose Yes, Update.
Important: Note the primary private IPv4 address and the new IP address for a later step.
- Connect to your Amazon EC2 Windows instance using Remote Desktop Protocol (RDP).
- Open Network and Sharing Center, and then choose Change adapter settings.
- Open the context (right-click) menu for the network connection, and then choose Properties.
- Select Internet Protocol Version 4 (TCP/IPv4), and then choose Properties.
- Choose Use the following IP address.
For IP address, enter the primary private IPv4 address.
For Subnet mask, enter the network mask for the subnet.
For Default gateway, enter the gateway for the subnet.
- For IP addresses, choose Add. Enter the new private IP address and subnet mask, and then choose Add.
- (Optional) Choose the DNS tab, enter a DNS server address, and then choose OK.
Note: For more information about finding your VPC DNS server settings, see Amazon DNS server. For information about reserved addresses, see VPC and subnet sizing.
To verify that the new IP address is successfully added, open a command prompt window as administrator and ping both private IP addresses. You should also be able to ping both addresses from another instance in the same subnet.