This topic describes how to create a VSwitch.

Background information

You can create VSwitches to partition a VPC into multiple subnets after you create the VPC. The VSwitches in a VPC can communicate with each other by default. Cloud resources must be deployed in VSwitches. You can deploy applications in VSwitches in different zones to improve service availability.
Note A VSwitch does not support multicast or broadcast.

Procedure

  1. Log on to the VPC console.
  2. In the left-side navigation pane, click VSwitches.
  3. Select the region of the VPC in which you want to create a VSwitch.
  4. On the VSwitches page, click Create VSwitch.
  5. On the Create VSwitch page, set the parameters, and then click OK. The following table describes the parameters.
    Note The IPv6 CIDR block can only be activated in the China (Hohhot) region. After the IPv6 CIDR block is activated, the system creates an IPv6 Gateway.
    Configuration Description
    Resource Group Select a resource group to which the VSwitch belongs.
    VPC Select a VPC to which the VSwitch belongs.
    IPv4 CIDR Block The IPv4 CIDR block of the selected VPC.
    IPv6 CIDR Block The IPv6 CIDR block of the selected VPC.
    Note If no IPv6 CIDR block is enabled for the selected VPC, click Enable IPv6 CIDR Block. After the IPv6 CIDR block is enabled, the system automatically creates an IPv6 Gateway of the Free Version for the VPC.
    Name Enter a name for the VSwitch.

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

    Zone Select the zone to which the VSwitch belongs. In a VPC, VSwitches that belong to different zones can communicate with each other through the intranet.
    IPv4 CIDR Block Enter the IPv4 CIDR block of the VSwitch. Note the following when you specify the IPv4 CIDR block:
    • The IPv4 CIDR block of the VSwitch can be the same as that of the VPC to which the VSwitch belongs, or be a subset of the VPC CIDR block.

      For example, if the CIDR block of the VPC is 192.168.0.0/16, the CIDR block of the VSwitch in the VPC can be 192.168.0.0/16, or any CIDR block between 192.168.0.0/17 and 192.168.0.0/29.

      Note If the CIDR block of the VSwitch is the same as that of the VPC, you can only create one VSwitch.
    • The subnet mask of the VSwitch CIDR block can be 16 to 29 bits. It means that the VSwitch can provide 8 to 65,536 IP addresses.
    • The first IP address and the last three IP addresses in the VSwitch CIDR block are reserved.

      For example, if the 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 the VSwitch needs to communicate with VSwitches of other VPCs or on-premises data centers, you need to make sure that the CIDR blocks involved do not conflict with each other.
    Notice You cannot modify the CIDR block of the VSwitch after the VSwitch is created.
    Number of Available Private IPs The number of available IPv4 addresses provided by the VSwitch.
    IPv6 CIDR Block Enter the IPv6 CIDR block of the VSwitch.

    The mask of the IPv6 CIDR block of the VSwitch is set to /64 by default. You can enter 0 to 255 to customize the last eight bits of the IPv6 CIDR block.

    For example, if the IPv6 CIDR block of the selected VPC is 2xx1:db8::/64, you can enter 255 (ff in hexadecimal notation). The IPv6 CIDR block of the VSwitch is 2xx1:db8:ff::/64.

    Description Enter a description for the VSwitch.

    The description must be 2 to 256 characters in length and cannot start with http:// or https://.