This topic describes how to assign an IPv6 address to a Linux instance. You can assign an IPv6 address to a Linux instance when you create the instance, or assign an IPv6 address to an existing Linux instance.
Prerequisites
- Before you assign an IPv6 address to an instance when you create the instance in a virtual private cloud (VPC), the VPC and the vSwitch to connect to the instance are assigned IPv6 CIDR blocks. For more information, see Enable IPv6 for a VPC and Enable IPv6 for a vSwitch.
- Before you assign an IPv6 address to an existing instance, the following requirements
are met:
- The instance supports IPv6. For information about whether the instance type of the instance supports IPv6, see Instance family.
- The network type of the instance is VPC. The VPC and vSwitch of the instance are assigned IPv6 CIDR blocks. For more information, see Enable IPv6 for a VPC and Enable IPv6 for a vSwitch.
- The instance is in the Running or Stopped state.
Assign an IPv6 address when you create an ECS instance
For information about how to create an instance, see Create an instance by using the wizard. Take note of the following items when you configure parameters:
- In the Basic Configurations step, find IPv6-supported instance types and select an instance type.
- In the Networking step, make the following configurations:
- Select a VPC and vSwitch for which IPv6 is enabled.
- Select Assign IPv6 Address Free of Charge.
- In the Preview step, confirm that an automatically selected IPv6 address or your specified IPv6 address is assigned.
Assign an IPv6 address to an existing instance
To assign an IPv6 address to an existing instance, perform the following operations:
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- Find the ECS instance to which you want to assign an IPv6 address. In the Actions column, choose .
- In the Manage Secondary Private IP Address dialog box, click Assign New IP next to IPv6 Address.
- Use one of the following methods to assign an IPv6 address:
- Auto-assign: The system assigns a new IPv6 address.
- Specify Address: You must specify an IPv6 address.
- Click OK.