When you create a vSwitch, you can specify an IPv4 CIDR block and an IPv6 CIDR block for the vSwitch. After you enable IPv6 for a vSwitch, the system assigns the specified IPv6 CIDR block to the vSwitch.

Background information

After you create a virtual private cloud (VPC) for which IPv6 is enabled, you can specify IPv6 CIDR blocks for vSwitches in the VPC. This way, cloud resources in a vSwitch can communicate with each other by using IPv6 addresses. You can enable IPv6 for a vSwitch by using one of the following methods:

Regions that support IPv6 gateways

The following regions support IPv6 gateways: China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), China (Hong Kong), Philippines (Manila), Singapore (Singapore), US (Virginia), and Germany (Frankfurt).

Prerequisites

  • A VPC is created and IPv6 is enabled for the VPC. For more information, see Enable IPv6 for a VPC.
  • The CIDR block that you specify for the new vSwitch does not overlap with the CIDR blocks of existing vSwitches in the VPC.

Create a vSwitch that supports IPv4 and IPv6

  1. Log on to the VPC console.
  2. In the left-side navigation pane, click vSwitch.
  3. In the top navigation bar, select the region where you want to create the vSwitch.
  4. On the vSwitch page, click Create vSwitch.
  5. On the Create vSwitch page, set the following parameters and click OK.
    Parameter Description
    VPC Select the VPC to which the vSwitch belongs.
    IPv4 CIDR Block Displays the IPv4 CIDR block of the VPC.
    IPv6 CIDR Block Displays the IPv6 CIDR block of the VPC.
    Note If IPv6 is disabled for the VPC, click Enable IPv6 CIDR Block. After IPv6 is enabled, the system automatically creates an IPv6 gateway of Free Edition.
    Name Enter a name for the vSwitch.

    The name must be 2 to 128 characters in length, and can contain digits, underscores (_), and hyphens (-). The name must start with a letter.

    Zone Select a zone for the vSwitch. In the same VPC, vSwitches in different zones can communicate with each other.
    Zone Resources Displays the cloud resources that can be created in the specified zone.

    The supported cloud resources vary based on the zone and the time when you create cloud resources. The instances provided in this topic are for reference only. The actual instances on the buy page shall prevail. You can query the status of Elastic Compute Service (ECS) instances, ApsaraDB RDS instances, and Classic Load Balancer (CLB) instances.

    IPv4 CIDR Block Specify an IPv4 CIDR block for the vSwitch. When you specify a CIDR block for the vSwitch, take note of the following limits:
    • The CIDR block of the vSwitch must be a subset of the CIDR block of the VPC.

      For example, if the CIDR block of the VPC is 192.168.0.0/16, you can specify a CIDR block from 192.168.0.0/17 to 192.168.0.0/29 for the vSwitch.

    • The subnet mask of the vSwitch CIDR block must be 16 to 29 bits in length, which provides 8 to 65,536 IP addresses.
    • The first IP address and last three IP addresses of a vSwitch CIDR block are reserved.

      For example, if a vSwitch CIDR block is 192.168.1.0/24, the IP addresses 192.168.1.0, 192.168.1.253, 192.168.1.254, and 192.168.1.255 are reserved.

    • If a vSwitch is required to communicate with vSwitches in other VPCs or with data centers, make sure that the CIDR block of the vSwitch does not overlap with the destination CIDR blocks.
    • The CIDR block of a vSwitch cannot be the same as or larger than the destination CIDR block of a route in the route table of the VPC to which the vSwitch belongs.
    Notice After you create a vSwitch, you cannot change its CIDR block.
    IPv6 CIDR Block

    Specify an IPv6 CIDR block for the vSwitch.

    By default, the subnet mask of the IPv6 CIDR block of a vSwitch is /64. To specify the last 8 bits of the IPv6 CIDR block, enter an integer from 0 to 255.

    For example, if the IPv6 CIDR block of the VPC is 2xx1:db8::/64, you can enter 255 to define the last 8 bits of the IPv6 CIDR block of the vSwitch. In this case, the IPv6 CIDR block of the vSwitch is 2xx1:db8:ff::/64. ff is the hexadecimal value of 255.

    Available IP Addresses Displays the number of available IPv4 addresses of the vSwitch.
    Description Enter a description for the vSwitch.

    The description must be 2 to 256 characters in length. The description cannot start with http:// or https://. You can also leave the parameter empty.

    Resource Group Select the resource group to which the vSwitch belongs.

Enable IPv6 for an existing vSwitch

  1. Log on to the VPC console.
  2. In the left-side navigation pane, click vSwitch.
  3. In the top navigation bar, select the region where the vSwitch is deployed.
  4. On the vSwitch page, find the vSwitch that you want to manage and click Enable IPv6 CIDR Block in the IPv6 CIDR Block column.
    openipv6
  5. In the Enable IPv6 dialog box, specify an IPv6 CIDR block and click OK.

    By default, the subnet mask of the IPv6 CIDR block of a vSwitch is /64. To specify the last 8 bits of the IPv6 CIDR block, enter an integer from 0 to 255.

    For example, if the IPv6 CIDR block of the VPC is 2xx1:db8::/64, you can enter 255 to define the last 8 bits of the IPv6 CIDR block of the vSwitch. In this case, the IPv6 CIDR block of the vSwitch is 2xx1:db8::ff/64. ff is the hexadecimal value of 255.

References