Help Center> Virtual Private Cloud> Getting Started> Setting Up an IPv6 Network

Setting Up an IPv6 Network

This topic describes how to create a VPC with IPv6 CIDR block and create an ECS with an IPv6 address in the VPC, so that the ECS can access the Internet. Figure 1 shows the configuration procedure.

Figure 1 Setting up an IPv6 network

If you already have shared bandwidth, you can configure an IPv6 address to access the Internet when purchasing an ECS.

Step 1: Create a VPC

Before creating your VPCs, determine how many VPCs, the number of subnets, and what IP address ranges you will need. For details, see Network Planning.

Perform the following operations to create a VPC named vpc-ipv6 and its default subnet named subnet-ipv6.

  1. Log in to the management console.
  2. Click in the upper left corner and select the desired region and project.
  3. Under Network, click Virtual Private Cloud.
  4. Click Create VPC.
  5. Set the VPC and subnet parameters as prompted.

    When configuring a subnet, select Enable for IPv6 CIDR Block so that the system will automatically allocate an IPv6 CIDR block to the subnet. IPv6 cannot be disabled after the subnet is created. Currently, customizing IPv6 CIDR block is not supported.

    Table 1 VPC parameter description

    Parameter

    Description

    Example Value

    Region

    Specifies the desired region. Regions are geographic areas that are physically isolated from each other. The networks inside different regions are not connected to each other, so resources cannot be shared across different regions. For lower network latency and faster access to your resources, select the region nearest you.

    CN North-Beijing4

    Name

    Specifies the VPC name.

    vpc-ipv6

    IPv4 CIDR Block

    Specifies the CIDR block of the VPC. The CIDR block of a subnet can be the same as the CIDR block for the VPC (for a single subnet in the VPC) or a subset of the CIDR block for the VPC (for multiple subnets in the VPC).

    The following CIDR blocks are supported:

    10.0.0.0/8–24

    172.16.0.0/12–24

    192.168.0.0/16–24

    192.168.0.0/16

    Enterprise Project

    When creating a VPC, you can add the VPC to an enabled enterprise project.

    An enterprise project facilitates project-level management and grouping of cloud resources and users. The name of the default project is default.

    For details about creating and managing enterprise projects, see the Enterprise Management User Guide.

    default

    Tag

    Specifies the VPC tag, which consists of a key and value pair. You can add a maximum of ten tags to each VPC.

    The tag key and value must meet the requirements listed in Table 3.

    • Key: vpc_key1
    • Value: vpc-01

    Table 2 Subnet parameter description

    Parameter

    Description

    Example Value

    AZ

    An AZ is a geographic location with independent power supply and network facilities in a region. AZs are physically isolated, and AZs in the same VPC are interconnected through an internal network.

    AZ2

    Name

    Specifies the subnet name.

    subnet-ipv6

    IPv4 CIDR Block

    Specifies the IPv4 CIDR block for the subnet. This value must be within the VPC CIDR block.

    192.168.0.0/24

    IPv6 CIDR Block

    Select Enable for IPv6 CIDR Block. An IPv6 CIDR block will be automatically assigned to the subnet. IPv6 cannot be disabled after the subnet is created. Currently, customizing IPv6 CIDR block is not supported.

    -

    Advanced Settings

    Two options are available, Default and Custom. You can set Advanced Settings to Custom to configure advanced subnet parameters.

    Default

    Gateway

    Specifies the gateway address of the subnet.

    This IP address is used to communicate with other subnets.

    192.168.0.1

    DNS Server Address

    By default, two DNS server addresses are configured. You can change them as required. Multiple IP addresses must be separated using commas (,).

    100.125.x.x

    Tag

    Specifies the subnet tag, which consists of a key and value pair. You can add a maximum of ten tags to each subnet.

    The tag key and value must meet the requirements listed in Table 4.

    • Key: subnet_key1
    • Value: subnet-01

    Table 3 VPC tag key and value requirements

    Parameter

    Requirements

    Example Value

    Key

    • Cannot be left blank.
    • Must be unique for the same VPC and can be the same for different VPCs.
    • Can contain a maximum of 36 characters.
    • Can contain letters, digits, underscores (_), and hyphens (-).

    vpc_key1

    Value

    • Can contain a maximum of 43 characters.
    • Can contain letters, digits, underscores (_), periods (.), and hyphens (-).

    vpc-01

    Table 4 Subnet tag key and value requirements

    Parameter

    Requirements

    Example Value

    Key

    • Cannot be left blank.
    • Must be unique for each subnet.
    • Can contain a maximum of 36 characters.
    • Can contain letters, digits, underscores (_), and hyphens (-).

    subnet_key1

    Value

    • Can contain a maximum of 43 characters.
    • Can contain letters, digits, underscores (_), periods (.), and hyphens (-).

    subnet-01

  6. Click Create Now.

Step 2: Buy an ECS

Restrictions

You can experience the IPv4/IPv6 dual-stack networks only when you select ECSs configured with specific flavors in the following regions.
  • SN3 ECSs in AZ2 of region CN North-Beijng4
  • C3 and M3 ECSs in AZ1 of region CN East-Shanghai1, and C3 ECSs in AZ2 of region CN East-Shanghai1

Buying an ECS

On the management console, under Computing, click Elastic Cloud Server, and then click Buy ECS. For details, see Elastic Cloud Server User Guide.

Configure the network as follows:

Figure 2 Network configuration
  • Network:
    • Select the created VPC vpc-ipv6.
    • Select the created subnet subnet-ipv6.
    • Select Self-assigned IPv6 address.
    • Shared Bandwidth
      • If you select Do not configure, only IPv6 communication in a VPC is supported. If you want to enable Internet access, you need to perform operations in (Optional) Step 3: Buy a Shared Bandwidth and Add the IPv6 Address to It.
      • If you assign a shared bandwidth or select an existing shared bandwidth, IPv6 address can access the Internet after the configuration is complete.
  • Security Group: Select the default security group Sys-default. The default security group rule allows all outgoing IPv4 and IPv6 data packets and denies all inbound data packets. ECSs in the same security group can access each other without the need to add rules. You can also create a security group and add rules to the security group. For details, see Creating a Security Group and Adding a Security Group Rule.
  • EIP: Select Not required.

After the ECS is created successfully, you can view the assigned IPv6 address on the ECS details page. You can also log in to the ECS and run the ifconfig command to view the assigned IPv6 address.

(Optional) Dynamically Assigning IPv6 Addresses

If an IPv6 address fails to be assigned or the selected image of an ECS does not support obtaining an IPv6 address automatically, manually obtain the IPv6 address by referring to Dynamically Assigning IPv6 Addresses.

(Optional) Step 3: Buy a Shared Bandwidth and Add the IPv6 Address to It

By default, the IPv6 address can only be used for private network communication. If you want to use this IPv6 address to access the Internet or be accessed by IPv6 clients on the Internet, you need to buy a shared bandwidth and add the IPv6 address to it.

If you already have a shared bandwidth, add the IPv6 address to the shared bandwidth.

Buying a Shared Bandwidth

  1. Log in to the management console.
  2. Click in the upper left corner and select the desired region and project.
  3. On the console homepage, under Network, click Virtual Private Cloud.
  4. In the navigation pane on the left, choose Elastic IP and Bandwidth > Shared Bandwidths.
  5. In the upper right corner, click Buy Shared Bandwidth. On the displayed page, configure parameters as prompted.
    Table 5 Parameter descriptions

    Parameter

    Description

    Example Value

    Billing Mode

    Specifies the billing mode of a shared bandwidth. The billing mode can be:

    • Yearly/Monthly: You pay for the bandwidth by year or month before using it. No charges will be incurred for the bandwidth during its validity period.
    • Pay-per-use: You pay for the bandwidth based on the amount of time you use the bandwidth.

    Yearly/Monthly

    Region

    Specifies the desired region. Regions are geographic areas that are physically isolated from each other. The networks inside different regions are not connected to each other, so resources cannot be shared across different regions. For lower network latency and faster access to your resources, select the region nearest you.

    CN North-Beijing4

    Bandwidth Name

    Specifies the name of the shared bandwidth.

    Bandwidth-001

    Billed By

    Specifies the shared bandwidth billing method. The shared bandwidth can be billed by bandwidth or 95th percentile bandwidth (enhanced).

    NOTE:
    • 95th percentile bandwidth (enhanced) can be selected only when Billing Mode is set to Pay-per-use.
    • Only customers with a level of V4 or higher can use the enhanced 95th percentile bandwidth billing. Enhanced 95th percentile bandwidth billing is based on average monthly bandwidth usage excluding peak traffic values. The charges will be deducted from your account balance on a monthly basis. You can specify the guaranteed minimum bandwidth by setting the bandwidth size and the minimum bandwidth percentage. If the monthly peak bandwidth is less than or equal to the guaranteed minimum bandwidth, you will be billed based on the guaranteed minimum bandwidth. If the monthly peak bandwidth is greater than the guaranteed minimum bandwidth, you will be billed based on the monthly peak bandwidth.

    Bandwidth

    Bandwidth

    Specifies the shared bandwidth size in Mbit/s. The minimum bandwidth that can be purchased is 5 Mbit/s.

    10

    Enterprise Project

    When assigning the shared bandwidth, you can add the shared bandwidth to an enabled enterprise project.

    An enterprise project facilitates project-level management and grouping of cloud resources and users. The name of the default project is default.

    For details about creating and managing enterprise projects, see the Enterprise Management User Guide.

    default

    Required Duration

    Specifies the required duration of the shared bandwidth to be purchased. You need to specify this parameter only in yearly/monthly billing mode.

    2 months

  6. Click Next.

Adding the IPv6 Address to a Shared Bandwidth

  1. On the Shared Bandwidths page, click Add Public IP Address in the Operation column.
    Figure 3 Adding an IPv6 address to a shared bandwidth
  2. Add the IPv6 address to the shared bandwidth.
    Figure 4 Adding a dual-stack NIC IPv6 address to a shared bandwidth
  3. Click OK.

Verifying the Result

Log in to an ECS and ping an IPv6 address on the Internet to verify the connectivity. For example, run the command ping6 ipv6.baidu.com or ping6 www.sina.com. Figure 5 shows an example of the command output.

Figure 5 Verification