Virtual Private Cloud (VPC)

更新时间:
复制 MD 格式

A Virtual Private Cloud (VPC) is a private network that you can provision on Alibaba Cloud. You have full control over your VPC, including selecting IP address ranges, configuring route tables, and setting up gateways. You can create a VPC and then deploy Alibaba Cloud resources, such as Elastic Compute Service (ECS) and Server Load Balancer (SLB) instances, within the VPC.

Set up a VPC

Workspace resources must be attached to at least one VPC. After you attach a VPC, all resources within that VPC are automatically associated with the workspace.

You can set up a VPC in the following ways:

  • Set up the VPC when you create the workspace.

  • Set up the VPC after you create the workspace.

Set up a VPC when you create a workspace

You can set up a VPC when you create a workspace. For more information, see Create a workspace.

Set up a VPC after you create a workspace

You can set up a virtual private cloud (VPC) after you create a workspace in the following scenarios:

  • The VPC setup failed when you created the workspace.

  • The VPC that you created was deleted.

Procedure

  1. Log on to the SOFAStack console. In the lower section of the navigation pane on the left, click Global Settings to open the workspace page.

  2. Click the card for the workspace that you want to manage to open the Workspace Details page.

  3. On the Resources page, click Virtual Private Cloud. In the area on the right:

    • If you click Add VPC:

      1. Enter a VPC Name. By default, the VPC Name is the same as the workspace name.

      2. Select a VPC CIDR Block.

      3. Click OK.

    • If you click Attach Existing VPC:

      1. Select an existing VPC.

      2. Click OK.

Create a vSwitch

You can create vSwitches to divide a VPC into one or more subnets.

Procedure

  1. Log on to the SOFAStack console. In the navigation pane on the left, click Global Settings to open the workspace page.

  2. Click the card for the workspace that you want to manage to open the Workspace Details page.

  3. On the Resources page, click Virtual Private Cloud. On the vSwitch tab, click Add vSwitch.

  4. In the Create vSwitch dialog box, enter the following information and click Submit.

    • Name: Enter a name for the vSwitch.

    • Zone: Select the zone for the vSwitch. vSwitches in different zones within the same VPC can communicate with each other over the private network. You can deploy vSwitches in different zones to implement cross-zone disaster recovery.

    • Custom CIDR Block: This feature is disabled by default. If you enable this feature, you must enter a CIDR block. The CIDR block of the vSwitch can be the same as the CIDR block of the VPC or a subnet of the CIDR block of the VPC.

    • Subnet Mask: If Custom CIDR Block is disabled, you must select a subnet mask and a CIDR block. The default subnet mask for a VPC is /16, such as 172.31.0.0/16, which provides up to 65,536 private IP addresses. The mask can range from /16 to /29, which provides from 4 to 65,532 IP addresses.

    • CIDR Block: The CIDR block of the VPC. This was selected when the workspace was created and cannot be changed.

    • Description: Optional. Enter a description for the vSwitch.

Delete a vSwitch

You can delete vSwitches that are no longer in use.

Prerequisites

  • A vSwitch has been created.

  • Before you delete a vSwitch, make sure that the Number of Associated Resource Instances for the vSwitch is 0. Otherwise, the vSwitch cannot be deleted.

Procedure

  1. Log on to the SOFAStack console. In the navigation pane on the left, click Global Settings to open the workspace page.

  2. Click the card for the workspace that you want to manage to open the Workspace Details page.

  3. On the Resources page, click Virtual Private Cloud.

  4. On the vSwitch tab, find the vSwitch that you want to delete, click Delete, and then click OK in the confirmation dialog box that appears.

View route entries

After you create a VPC and a vSwitch, the system automatically creates system route entries to manage traffic for the VPC. A route entry specifies the destination of network traffic and consists of a destination CIDR block, a next hop type, and a next hop instance.

  1. Log on to the SOFAStack console. In the navigation pane on the left, click Global Settings to open the workspace list page.

  2. Click the card for the workspace that you want to manage to open the Workspace Details page.

  3. On the Resources page, click the Virtual Private Cloud > Route Entries tab to view information about the route entries, such as the destination CIDR block, next hop type, next hop instance, and type.