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.

Background information

By default, when you create an ECS instance, a private IPv4 address is assigned instead of an IPv6 address.

Assign an IPv6 address when you create an ECS instance

Prerequisites: The virtual private cloud (VPC) and vSwitch of the instance are assigned IPv6 CIDR blocks. For more information, see Create an IPv6 VPC.

Procedure: Create an ECS instance. For more information, see Create an instance by using the wizard. Take note of the following items when you configure parameters:
  • In the Basic Configurations step, filter out IPv6-supported instance types, and then select an instance type.
  • In the Networking step, select a VPC and a vSwitch for which IPv6 is enabled, and then select Assign IPv6 Address Free of Charge.
  • In the Preview step, confirm that the IPv6 address is selected.

Assign an IPv6 address to an existing instance

Prerequisites:
  • The instance supports IPv6. For more information about the instance types that support IPv6, see Instance families.
  • The network type of the instance is VPC. The VPC and vSwitch of the instance are assigned IPv6 CIDR blocks. For more information, see Create an IPv6 VPC.
  • The instance is in the Running or Stopped state.

To assign an IPv6 address to an existing instance, perform the following operations:

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. Select the ECS instance to which you want to assign an IPv6 address and click More in the Actions column.
  5. Choose Network and Security Group > Manage Secondary Private IP Address.
  6. Click Assign New IP next to IPv6 Address.
  7. 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.
  8. Click OK.