Manage the IP addresses for your network interface - Amazon Elastic Compute Cloud

Manage the IP addresses for your network interface

You can manage the following IP addresses for your network interfaces:

To manage the Elastic IP addresses of a network interface using the console
  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose Network Interfaces.

  3. Select the checkbox for the network interface.

  4. To associate an Elastic IP address, do the following:

    1. Choose Actions, Associate address.

    2. For Elastic IP address, select the Elastic IP address.

    3. For Private IPv4 address, select the private IPv4 address to associate with the Elastic IP address.

    4. (Optional) Choose Allow the Elastic IP address to be reassociated if the network interface is currently associated with another instance or network interface.

    5. Choose Associate.

  5. To disassociate an Elastic IP address, do the following:

    1. Choose Actions, Disassociate address.

    2. For Public IP address, select the Elastic IP address.

    3. Choose Disassociate.

To manage the IPv4 and IPv6 addresses of a network interface using the console
  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

  2. In the navigation pane, choose Network Interfaces.

  3. Select the network interface.

  4. Choose Actions, Manage IP addresses.

  5. Expand the network interface.

  6. For IPv4 addresses, modify the IP addresses as needed. To assign an IPv4 address, choose Assign new IP address and then specify an IPv4 address from the subnet range or let AWS choose one for you. To unassign an IPv4 address, choose Unassign next to the address.

  7. To assign or unassign a public IPv4 address to a network interface, choose Auto-assign public IP. This option can be enabled or disabled for any network interface but will only apply to the primary network interface (eth0).

  8. For IPv6 addresses, modify the IP addresses as needed. To assign an IPv6 address, choose Assign new IP address and then specify an IPv6 address from the subnet range or let AWS choose one for you. To unassign an IPv6 address, choose Unassign next to the address.

  9. (Optional) If your modifying a network interface in a dual-stack or IPv6-only subnet, you have the option to Assign Primary IPv6 IP. Assigning a primary IPv6 address enables you to avoid disrupting traffic to instances or ENIs. Choose Enable if the instance that this ENI will be attached to relies on its IPv6 address not changing. AWS will automatically assign an IPv6 address associated with the ENI attached to your instance to be the primary IPv6 address. Once you enable an IPv6 GUA address to be a primary IPv6, you can't disable it. When you enable an IPv6 GUA address to be a primary IPv6, the first IPv6 GUA will be made the primary IPv6 address until the instance is terminated or the network interface is detached. If you have multiple IPv6 addresses associated with an ENI attached to your instance and you enable a primary IPv6 address, the first IPv6 GUA address associated with the ENI becomes the primary IPv6 address.

  10. Choose Save.

To manage the IP addresses of a network interface using the AWS CLI

You can use one of the following commands. For more information about these command line interfaces, see Access Amazon EC2.

To manage the IP addresses of a network interface using the Tools for Windows PowerShell

You can use one of the following commands.