A subnet is a unique CIDR block with a range of IP addresses in a VPC. All resources in a VPC must be deployed on subnets.
When creating a VPC, you need to create at least one subnet. If one subnet cannot meet your requirements, you can create more subnets for the VPC.
After a subnet is created, some IP addresses are reserved by the system and cannot be assigned to any instance. For example, in a subnet with CIDR block of 192.168.0.0/24, the following IP addresses are reserved by default:
These IP addresses are for reference only. The system assigns reserved IP addresses based on your subnet settings. All other IP addresses in the subnet can be assigned to instances.
in the upper left corner and choose Network > Virtual Private Cloud.The Virtual Private Cloud page is displayed.
The Create Subnet page is displayed.
You can click
to add more subnets.
Parameter | Description | Example Value |
|---|---|---|
Region | The region where the VPC is located. | - |
VPC | The VPC for which you want to create a subnet. | vpc-test |
Subnet Name | The subnet name. The name: | 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:
| 10.0.0.0/24 |
IPv6 CIDR Block (Optional) | If you select this option, the system automatically assigns an IPv6 CIDR block to the created subnet. Currently, the IPv6 CIDR block cannot be customized. IPv6 CIDR block cannot be disabled after the subnet is created. | N/A |
Associated Route Table | 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. | N/A |
Advanced Settings (Optional) > Gateway | Click The gateway address of the subnet. Retain the default value unless there are special requirements. | 10.0.0.1 |
Advanced Settings (Optional) > DNS Server Address | Click 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 (Optional) > Domain Name | Click You can enter multiple domain name suffixes separated by spaces. A domain name can contain one or more character strings separated by periods (.). Each character string can contain a maximum of 63 characters. (For example, domain name test.com contains two character strings: test and com.) The total length of the domain name cannot exceed 254 characters. 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 (Optional) > NTP Server Address | Click If you want to add NTP server addresses for a subnet, you can specify NTP Server Address. The IP addresses here are added in addition to the default NTP server addresses. | 192.168.2.1 |
Advanced Settings (Optional) > IPv4 DHCP Lease Time | Click 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. If the time period is changed, the new lease time takes effect when the instance (such as an ECS) in the subnet is renewed next time. You can wait for the instance to be renewed automatically or manually modify the lease time. If you want the new lease time to take effect immediately, manually renew the lease or restart the ECS. | N/A |
Advanced Settings (Optional) > Tag | Click Add tags to help you quickly identify, classify, and search for your subnets. For details, see Managing Subnet Tags. |
|
Advanced Settings > Description | Click 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 >). | N/A |
Return to the subnet list and view the new subnet.