Creating a VPC
Scenarios
A VPC provides an isolated virtual network for ECSs. You can configure and manage the network as required.
Create a VPC by following the procedure provided in this section. Then, create subnets, security groups, and assign EIPs by following the procedure provided in subsequent sections based on your actual network requirements.
Procedure
- Log in to the management console.
- Click
in the upper left corner and select the desired region and project. - On the console homepage, under Network, click Virtual Private Cloud.
- Click Create VPC.
- On the Create VPC page, set parameters as prompted.
A default subnet will be created together with a VPC and you can also click Add Subnet to create more subnets for the VPC.
Table 1 VPC parameter descriptions Parameter
Description
Example Value
Region
Regions are geographic areas that are physically isolated from each other. The networks inside different regions are not connected to each other, so resources cannot be shared across different regions. For lower network latency and faster access to your resources, select the region nearest you.
CN North-Beijing1
Name
The VPC name.
The name can contain a maximum of 64 characters, which may consist of letters, digits, underscores (_), hyphens (-), and periods (.). The name cannot contain spaces.
VPC-001
CIDR Block or IPv4 CIDR Block
The CIDR block of the VPC. The CIDR block of a subnet can be the same as the CIDR block for the VPC (for a single subnet in the VPC) or a subset of the CIDR block for the VPC (for multiple subnets in the VPC).
The following CIDR blocks are supported:
10.0.0.0/8-24
172.16.0.0/12-24
192.168.0.0/16-24
192.168.0.0/16
Enterprise Project
When creating a VPC, you can add the VPC to an enabled enterprise project.
An enterprise project facilitates project-level management and grouping of cloud resources and users. The name of the default project is default.
For details about creating and managing enterprise projects, see the Enterprise Management User Guide.
default
Advanced Settings
Click the drop-down arrow to set advanced VPC parameters, including tags.
Default
Tag
The VPC tag, which consists of a key and value pair. You can add a maximum of 10 tags to each VPC.
The tag key and value must meet the requirements listed in Table 3.
- Key: vpc_key1
- Value: vpc-01
Table 2 Subnet parameter descriptions Parameter
Description
Example Value
AZ
An AZ is a geographic location with independent power supply and network facilities in a region. AZs are physically isolated, and AZs in the same VPC are interconnected through an internal network.
AZ1
Name
The subnet name.
The name can contain a maximum of 64 characters, which may consist of letters, digits, underscores (_), hyphens (-), and periods (.). The name cannot contain spaces.
Subnet
CIDR Block
The CIDR block for the subnet. This value must be within the VPC CIDR block.
192.168.0.0/24
IPv4 CIDR Block
The CIDR block for the subnet. This value must be within the VPC CIDR block.
192.168.0.0/24
IPv6 CIDR Block
Specifies whether to set IPv6 CIDR Block to Enable.
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.
-
Associated Route Table
The default route table to which the subnet will be associated. You can change the route table to a custom route table on the Subnets page.
Default
Advanced Settings
Click the drop-down arrow to set advanced settings for the subnet, including Gateway and DNS Server Address.
Default
Gateway
The gateway address of the subnet.
This IP address is used to communicate with other subnets.
192.168.0.1
DNS Server Address
DNS server addresses allow ECSs in a VPC subnet to communicate with each other using private network 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.
A maximum of two DNS server IP addresses can be configured. Multiple IP addresses must be separated using commas (,).
100.125.x.x
DHCP Lease Time
The period during which a client can use an IP address automatically assigned by the DHCP server. After the lease time expires, a new IP address will be assigned to the client. Unit: Day/Hour
If a DHCP lease time is changed, the new lease automatically takes effect when half of the current lease time has passed. To make the change take effect immediately, restart the ECS or log in to the ECS to cause the DHCP lease to automatically renew. For more information, see How Do I Make the Changed DHCP Lease Time of a Subnet Take Effect Immediately?
365 days
Tag
The subnet tag, which consists of a key and value pair. You can add a maximum of 10 tags to each subnet.
The tag key and value must meet the requirements listed in Table 4.
- Key: subnet_key1
- Value: subnet-01
Table 3 VPC tag key and value requirements Parameter
Requirements
Example Value
Key
- Cannot be left blank.
- Must be unique for the same VPC and can be the same for different VPCs.
- Can contain a maximum of 36 characters.
- Can contain letters, digits, underscores (_), and hyphens (-).
vpc_key1
Value
- Can contain a maximum of 43 characters.
- Can contain letters, digits, underscores (_), periods (.), and hyphens (-).
vpc-01
Table 4 Subnet tag key and value requirements Parameter
Requirements
Example Value
Key
- Cannot be left blank.
- Must be unique for each subnet.
- Can contain a maximum of 36 characters.
- Can contain letters, digits, underscores (_), and hyphens (-).
subnet_key1
Value
- Can contain a maximum of 43 characters.
- Can contain letters, digits, underscores (_), periods (.), and hyphens (-).
subnet-01
- Confirm the current configuration and click Create Now.
Last Article: VPC
Next Article: Modifying a VPC
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.