Manage the IPv6 addresses for your EC2 instances
If your VPC and subnet have IPv6 CIDR blocks associated with them, you can assign an IPv6 address to your instance during or after launch. You can view the IPv6 addresses for your instances in the console on either the Instances page or the Network Interfaces page.
Contents
Assign an IPv6 address to an instance
You can specify an IPv6 address from the IPv6 address range of the subnet, or let Amazon choose one for you. This address is assigned to the primary network interface. Note that the following instance types do not support IPv6 addresses: C1, M1, M2, M3, and T1.
To assign an IPv6 address during instance launch
Follow the procedure to launch an instance. When you configure Network Settings, choose the option to Auto-assign IPv6 IP.
To assign an IPv6 address after launch
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/
. -
In the navigation pane, choose Instances.
-
Select your instance, and choose Actions, Networking, Manage IP addresses.
-
Expand the network interface. Under IPv6 addresses, choose Assign new IP address. Enter an IPv6 address from the range of the subnet or leave the field blank to let Amazon choose one for you.
-
Choose Save.
To assign an IPv6 address using the command line
You can use one of the following commands. For more information about these command line interfaces, see Access Amazon EC2.
-
Use the
--ipv6-addresses
option with the run-instances command (AWS CLI) -
Use the
Ipv6Addresses
property for-NetworkInterface
in the New-EC2Instance command (AWS Tools for Windows PowerShell) -
assign-ipv6-addresses (AWS CLI)
-
Register-EC2Ipv6AddressList (AWS Tools for Windows PowerShell)
View the IPv6 addresses
You can use the Amazon EC2 console, AWS CLI, and instance metadata to view the IPv6 addresses for your instances.
To view the IPv6 addresses for an instance using the console
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/
. -
In the navigation pane, choose Instances.
-
Select the instance.
-
On the Networking tab, locate IPv6 addresses.
To view the IPv6 addresses for an instance using the command line
You can use one of the following commands. For more information about these command line interfaces, see Access Amazon EC2.
-
describe-instances (AWS CLI)
-
Get-EC2Instance (AWS Tools for Windows PowerShell).
To view the IPv6 addresses for an instance using instance metadata
-
Connect to your instance. For more information, see Connect to your EC2 instance.
-
Get the MAC address of the instance from
http://169.254.169.254/latest/meta-data/network/interfaces/macs/
. -
Use the following command to view the IPv6 address.
Unassign an IPv6 address from an instance
You can unassign an IPv6 address from an instance at any time.
To unassign an IPv6 address from an instance using the console
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/
. -
In the navigation pane, choose Instances.
-
Select your instance, and choose Actions, Networking, Manage IP addresses.
-
Expand the network interface. Under IPv6 addresses, choose Unassign next to the IPv6 address.
-
Choose Save.
To unassign an IPv6 address from an instance using the command line
You can use one of the following commands. For more information about these command line interfaces, see Access Amazon EC2.
-
unassign-ipv6-addresses (AWS CLI)
-
Unregister-EC2Ipv6AddressList (AWS Tools for Windows PowerShell).