Updated on 2026-01-05 GMT+08:00

Step 1: Create a VPC

Scenarios

Virtual Private Cloud (VPC) allows you to provision logically isolated virtual private networks for cloud resources, such as cloud servers, containers, and databases.

You can create a VPC, specify a CIDR block, and create one or more subnets for the VPC. A VPC comes with a default route table that enables subnets in the VPC to communicate with each other.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and choose Network > Virtual Private Cloud.

    The Virtual Private Cloud page is displayed.

  3. Click Create VPC.

    The Create VPC page is displayed.

  4. On the Create VPC page, set parameters for the VPC and subnets as prompted.
    Table 1 VPC parameter description

    Parameter

    Description

    Example Value

    Region

    Regions are geographic areas isolated from each other. For low network latency and quick resource access, select the region nearest to where your services will be accessed.

    -

    Name

    The VPC name. The name:
    • Can contain 1 to 64 characters.
    • Can contain letters, digits, underscores (_), hyphens (-), and periods (.).

    vpc-test

    IPv4 CIDR Block

    The IPv4 CIDR block of the VPC. Consider the following when specifying a CIDR block:
    • Number of IP addresses: Reserve enough IP addresses for subsequent business growth.
    • IP address ranges: Avoid IP address conflicts if you need to connect a VPC to an on-premises data center or connect two VPCs.
    When you create a VPC, we recommend that you use the private IPv4 address ranges specified in RFC 1918 as the CIDR block:
    • 10.0.0.0/8–24: The IP address ranges from 10.0.0.0 to 10.255.255.255, and the netmask ranges from 8 to 24.
    • 172.16.0.0/12–24: The IP address ranges from 172.16.0.0 to 172.31.255.255, and the netmask ranges from 12 to 24.
    • 192.168.0.0/16–24: The IP address ranges from 192.168.0.0 to 192.168.255.255, and the netmask ranges from 16 to 24.
    In addition to the preceding addresses, you can create a VPC with a publicly routable CIDR block that falls outside of the private IPv4 address ranges specified in RFC 1918. However, the following system and public reserved addresses must be excluded:
    • Reserved system CIDR blocks
      • 100.64.0.0/10
      • 214.0.0.0/7
      • 198.18.0.0/15
      • 169.254.0.0/16
    • Reserved public CIDR blocks
      • 0.0.0.0/8
      • 127.0.0.0/8
      • 240.0.0.0/4

    10.0.0.0/8

    Enterprise Project

    The enterprise project to which the VPC belongs.

    An enterprise project facilitates project-level management and grouping of cloud resources and users. The name of the default project is default.

    default

    Advanced Settings > Tag

    The VPC tag. Click to expand the configuration area and set this parameter.

    Add tags to help you quickly identify, classify, and search for your VPCs.

    • Key: vpc_key1
    • Value: vpc-01

    Advanced Settings > Description

    The VPC tag. Click to expand the configuration area and set this parameter.

    Enter the description about the VPC in the text box as required.

    The VPC description can contain a maximum of 255 characters and cannot contain angle brackets (< or >).

    -

    Table 2 Subnet parameter descriptions

    Parameter

    Description

    Example Value

    Name

    The subnet name. The name:
    • Can contain 1 to 64 characters.
    • Can contain letters, digits, underscores (_), hyphens (-), and periods (.).

    subnet-01

    IPv4 CIDR Block

    The IPv4 CIDR block of the subnet. A subnet is a unique CIDR block with a range of IP addresses in a VPC. Comply with the following principles when planning subnets:

    • Planning the CIDR block size: After a subnet is created, the CIDR block cannot be changed. You need to plan the CIDR block in advance based on the number of IP addresses required by your service.
      • The subnet CIDR block cannot be too small. Ensure that the number of available IP addresses in the subnet meets service requirements. Remember that the first and last three addresses in a subnet CIDR block are reserved for system use. For example, in subnet 10.0.0.0/24, 10.0.0.1 is the gateway address, 10.0.0.253 is the system interface address, 10.0.0.254 is used by DHCP, and 10.0.0.255 is the broadcast address.
      • The subnet CIDR block cannot be too large, either. If you use a CIDR block that is too large, you may not have enough CIDR blocks from the VPC available for new subnets, which can be a problem when you want to scale out services.
    • Avoiding subnet CIDR block conflicts: If you need to connect two VPCs or connect a VPC to an on-premises data center, the CIDR blocks to be connected cannot be the same.

    10.0.0.0/24

    IPv6 CIDR Block

    After the IPv6 function is enabled, the system automatically assigns an IPv6 CIDR block to the created subnet. Currently, the IPv6 CIDR block cannot be customized. IPv6 cannot be disabled after the subnet is created.

    -

    Association Route Table

    The default route table with which the subnet will be associated. A route table contains a set of routes that are used to control the traffic routing for your subnets in a VPC. A default route table automatically comes with a VPC. Subnets in the VPC are automatically associated with the default route table. The default route table ensures that subnets in a VPC can communicate with each other.

    -

    Advanced Settings > Gateway

    The gateway address of the subnet. Click to expand the configuration area and set this parameter.

    Retain the default value unless there are special requirements.

    10.0.0.1

    Advanced Settings > DNS Server Address

    The gateway address of the subnet. Click to expand the configuration area and set this parameter.

    DNS server addresses allow ECSs in a VPC subnet to communicate with each other using private domain names. You can also directly access cloud services through private DNS servers.

    If you want to use other public DNS servers for resolution, you can change the default DNS server addresses. Changing the default DNS server addresses may cause communication failures in the subnet.

    100.125.x.x

    Advanced Settings > Domain Name

    The gateway address of the subnet. Click to expand the configuration area and set this parameter.

    To access a domain name, you only need to enter the domain name prefix. ECSs in the subnet automatically match the configured domain name suffix.

    If the domain names are changed, ECSs newly added to this subnet will use the new domain names.

    If an existing ECS in this subnet needs to use the new domain names, restart the ECS or run a command to restart the DHCP Client service or network service.

    test.com

    Advanced Settings > Tag

    The gateway address of the subnet. Click to expand the configuration area and set this parameter.

    Add tags to help you quickly identify, classify, and search for your subnets.

    • Key: subnet_key1
    • Value: subnet-01

    Advanced Settings > Description

    The gateway address of the subnet. Click to expand the configuration area and set this parameter.

    Enter the description about the subnet in the text box as required.

    The subnet description can contain a maximum of 255 characters and cannot contain angle brackets (< or >).

    -

  5. Click Create Now.

    Return to the VPC list and view the new VPC.