VSwitch is a basic network device in a VPC. It is used for connecting different cloud product instances.

After creating a VPC, you can create one or more subnets in the VPC by creating VSwitches. Different VSwitches in a VPC can communicate with each other through the intranet. You can deploy an application in different VSwitches located in different zones to improve the service availability.

Note
A VSwitch does not support multicast or broadcast. You can achieve multicast proxy by using the multicast agent tool provided by Alibaba Cloud. For more information, see.

IP address range

When creating a VSwitch, you must specify the private IP address range of the VSwitch in the form of Classless Inter-Domain Routing (CIDR) block. The selection of the CIDR block is related to your network planning. For more information, see Plan and design VPC.

Note the following when specifying the VSwitch CIDR block:
  • The CIDR block of the VSwitch can be the same as that of the VPC to which it belongs, or 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, 192.168.0.0/17, …, till 192.168.0.0/29.

    Note
    If the CIDR block of the VSwitch is the same as that of the VPC to which it belongs, you can only create one VSwitch in the VPC.
  • The size of the subnet mask for the VSwitch can be /16 to /29, and the VSwitch CIDR block can provide 8 to 65536 IP addresses.

  • The first and last three IP addresses are reserved by the system.

    Take the IP address range 192.168.1.0/24 as an example, IP addresses 192.168.1.0, 192.168.1.253, 192.168.1.254, and 192.168.1.255 are reserved by the system.

  • Consider the number of cloud instances to be created in the VSwitch. Up to 15000 instances can be created in a VPC.

Create a VSwitch

Complete these steps to create a VSwitch:

  1. Log on to the VPC console.
  2. Select the region of the VPC to which the VSwitch belongs.
  3. In the left-side navigation pane, click VSwitches.
  4. Click Create VSwitch, configure the VSwitch according to the following information and click OK.
    Configuration Description
    VPC configurations
    VPC Select the VPC to which the VSwitch belongs.
    CIDR Display the CIDR block of the VPC.
    Name Enter the name of the VSwitch.

    The name can contain 2 to 128 characters. It must begin with English or Chinese characters and can contain numbers, hyphens (-) and underlines (_).

    Zone Select the zone of the VSwitch. In a VPC, VSwitches in different zones can communicate with each other through the intranet.
    Zone Resource Display cloud resources that can be created and used in the selected zone.
    CIDR Enter the CIDR block of the VSwitch.
    Note
    After the VSwitch is created, you cannot change its CIDR block. 
    Number of Available Private IPs Display the number of available private IPs of the VSwitch.
    Description Enter the description of the VSwitch.

    The description can contain 2 to 256 characters and cannot begin with http:// or https://.

Create cloud resources in a VSwitch

Complete these steps to create cloud resources in a VSwitch:
  1. Log on to the VPC console.
  2. Select the region of the VPC.
  3. In the left-side navigation pane, click VSwitches.
  4. Find the target VSwitch, click Purchase and select the cloud resources to create.
  5. Complete the configuration.

Delete a VSwitch

Prerequisite

  • You have deleted cloud resources such as ECS, SLB, and RDS under the VSwitch.

  • If the VSwitch has configured any SNAT entry, VPN gateway, or HAVIP, make sure you have deleted the associated resources.

Complete these steps to delete a VSwitch:
  1. Log on to the VPC console.
  2. Select the region of the VPC.
  3. In the left-side navigation pane, click VSwitches.
  4. Find the target VSwitch, and click Delete.
  5. In the displayed dialog box, click OK.

Related APIs

CreateVSwitch

Deletevswitch

DescribeVSwitches

ModifyVSwitchAttribute