Help Center/ Elastic IP/ User Guide (Ally Region)/ Getting Started/ Step 2: Create a Subnet for the VPC
Updated on 2026-01-05 GMT+08:00

Step 2: Create a Subnet for the VPC

Scenarios

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.

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. In the navigation pane on the left, choose Virtual Private Cloud > Subnets.
  4. Click Create Subnet.

    The Create Subnet page is displayed.

  5. Set the parameters as prompted.
    Table 1 Subnet parameter descriptions

    Parameter

    Description

    Example Value

    VPC

    The VPC for which you want to create a subnet.

    vpc-test

    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 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. The first and last three addresses in a subnet 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: Avoid CIDR block conflicts if you need to connect two VPCs or connect a VPC to an on-premises data center.

    10.0.0.0/24

    IPv6 CIDR Block

    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.

    -

    Association 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.

    -

    Advanced Settings > Gateway

    Click to expand the configuration area and set this parameter.

    The gateway address of the subnet. Retain the default value unless there are special requirements.

    10.0.0.1

    Advanced Settings > DNS Server Address

    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

    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

    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

    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 >).

    -

  6. Click Create Now.

    Return to the subnet list and view the new subnet.

Constraints

  • 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:
    • 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: The gateway address of the subnet.
    • 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.

    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.