Step 2: Create a Subnet for the VPC
Scenarios
A VPC comes with a default subnet. If the default subnet cannot meet your requirements, you can create one.
The subnet is configured with DHCP by default. When an ECS in this subnet starts, the ECS automatically obtains an IP address using DHCP.
Procedure
- Log in to the management console.
- On the console homepage, under Network, click Virtual Private Cloud.
- In the navigation pane on the left, click Subnets.
- Click Create Subnet.
The Create Subnet page is displayed.
- Set the parameters as prompted.
Table 1 Parameter descriptions Parameter
Description
Example Value
VPC
The VPC for which you want to create a subnet.
-
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
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.
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 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/Gateway
The gateway address of the subnet.
This IP address is used to communicate with other subnets.
192.168.0.1
Advanced Settings/DNS Server Address
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.
A maximum of two DNS server IP addresses can be configured. Multiple IP addresses must be separated using commas (,).
100.125.x.x
Advanced Settings/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 2.
- Key: subnet_key1
- Value: subnet-01
Table 2 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
- Click OK.
Precautions
When a subnet is created, there are five reserved IP addresses, which cannot be used. For example, in a subnet with CIDR block 192.168.0.0/24, the following IP addresses are reserved:
- 192.168.0.0: Network ID. This address is the beginning of the private IP address range and will not be assigned to any instance.
- 192.168.0.1: Gateway address.
- 192.168.0.253: Reserved for the system interface. This IP address is used by the VPC for external communication.
- 192.168.0.254: DHCP service address.
- 192.168.0.255: Network broadcast address.
If you configured the default settings under Advanced Settings during subnet creation, the reserved IP addresses may be different from the default ones, but there will still be five of them. The specific addresses depend on your subnet settings.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot