A vSwitch is a basic network component that connects different cloud resources in a virtual private cloud (VPC). After you create a vSwitch, you can create resources in the vSwitch and associate the vSwitch with a custom route table or a network access control list (ACL). This topic describes how to work with vSwitches.
Operations
Create a vSwitch
After you create a VPC, you can create vSwitches to divide the VPC into one or more subnets. vSwitches in the same VPC can communicate with each other. Cloud resources must be deployed in vSwitches. You can deploy applications in vSwitches that belong to different zones to improve service availability. vSwitches do not support multicasting or broadcasting.
Modify the basic information about a vSwitch
After you create a vSwitch, you can modify its name and description.
Create cloud resources in a vSwitch
You cannot directly deploy cloud resources in a VPC. You must deploy cloud resources in a vSwitch that belongs to the VPC.
Associate a vSwitch with a custom route table
After you create a custom route table, you can perform the following operations in a vSwitch. For more information about how to create a custom route table, see Create a custom route table.- Associate a custom route table: If a vSwitch is associated with the system route table, you can associate the vSwitch with a custom route table to manage routes of the vSwitch. Each vSwitch can be associated with only one custom route table or one system route table. After a vSwitch is associated with a custom route table, the system route table is automatically disassociated from the vSwitch.
- Replace a custom route table: You can replace an associated custom route table with another one as needed.
- Disassociate a custom route table: You can disassociate a custom route table from a vSwitch. After the custom route table is disassociated, the vSwitch is automatically associated with the system route table.
Associate a network ACL with a vSwitch
You can use a network ACL to regulate access control for a VPC. You can create a custom network ACL and associate it with a vSwitch. This way, you can control traffic of the elastic network interface (ENI) of the vSwitch. When you associate a network ACL with a vSwitch, they must belong to the same VPC. Each vSwitch can be associated with only one network ACL.After you create a network ACL, you can perform the following operations in a vSwitch. For more information about how to create a network ACL, see Work with network ACLs.
- Associate a network ACL: You can associate a network ACL with a vSwitch to control traffic of the vSwitch ENI.
- Replace an associated network ACL: You can replace the network ACL that is associated with a vSwitch with another network ACL. After the network ACL is replaced, the new network ACL takes effect immediately and controls traffic of ECS instances that belong to the vSwitch.
- Disassociate a network ACL: You can disassociate a network ACL from a vSwitch. Then, the network ACL no longer controls traffic of the ECS instances that belong to the vSwitch.
- Log on to the VPC console.
- In the left-side navigation pane, click vSwitch.
- In the top navigation bar, select the region of the VPC to which the vSwitch belongs.
- On the vSwitch page, find the vSwitch that you want to manage and click its ID.
- In the vSwitch Basic Information section, you can perform the following operations:
- Associate a network ACL
- Click Bind next to Network ACL.
- In the Bind Network ACL dialog box, select the network ACL that you want to associate and click OK.
- Replace an associated network ACL
- Click Change next to Network ACL.
- In the Bind Network ACL dialog box, select the network ACL that you want to associate and click OK.
- Disassociate a network ACL
- Click Unbind next to Network ACL.
- In the Unbind Network ACL message, click OK.
- Associate a network ACL
Delete a vSwitch
You can delete a vSwitch that you no longer need. After you delete a vSwitch, you cannot deploy cloud resources in it.
Before you delete a vSwitch, make sure that the following requirements are met:
- Resources of the following services are deleted from the vSwitch: ECS, CLB, ApsaraDB RDS, ApsaraDB for MongoDB, PolarDB, Elasticsearch, Time Series Database (TSDB), ApsaraDB for HBase, ApsaraDB for ClickHouse, Tablestore, Container Registry, Elastic High Performance Computing (E-HPC), Data Lake Analytics (DLA), Database Backup (DBS), and Apsara File Storage NAS (NAS).
- If the vSwitch that you want to delete is associated with SNAT entries, high-availability virtual IP addresses (HAVIPs), custom route tables, or network ACLs, delete them.
- Log on to the VPC console.
- In the left-side navigation pane, click vSwitch.
- Select the region where the vSwitch that you want to delete is deployed.
- On the vSwitch page, find the vSwitch that you want to delete and click Delete in the Actions column.
- In the Delete vSwitch message, click OK.