Assign an Elastic IP Address to Your Instance

时间:2024-01-21 08:50:21

By default, an instance in a nondefault VPC is not assigned a public IP address, and is private.You can

make an instance in a nondefault VPC public by attaching an Internet gateway to the VPC and providing

the instance with a public IP address. In this exercise, you created an Internet gateway for your VPC

using the VPC wizard.You accepted the default settings in the launch wizard, so you did not receive a

public IP address. Now, you'll create an Elastic IP address, which is a public IP address that belongs to

your AWS account, and associate it with your instance to make it accessible from the Internet.

For more information about Elastic IP addresses, see Elastic IP Addresses in the Amazon Virtual Private

Cloud User Guide.

To allocate and assign an Elastic IP address

1. Open the Amazon VPC console at https://console.aws.amazon.com/vpc/.

2. Click Elastic IPs in the navigation pane.

3. Click the Allocate New Address button.

4. In the EIP used in list, select VPC, and then click Yes, Allocate. Note that if your account supports

EC2-VPC only, you will not have an option to select where your Elastic IP will be used.

5. Select the Elastic IP address from the list and click the Associate Address button.

6. In the Associate Address dialog box, do the following, and then click Associate:

Assign an Elastic IP Address to Your Instance

a. Select the network interface from the Network Interface list, or select the instance from the

Instance list. Note that the advantage of making the Elastic IP address as an attribute of the

network interface instead of associating it directly with the instance is that you can move all the

attributes of the network interface from one instance to another in a single step.

b. Select the IP address to associate the EIP with from the corresponding Private IP address list.