Updated on 2023-04-26 GMT+08:00

Creating a Subnet for the VPC


A VPC comes with a default subnet. If the default subnet cannot meet your requirements, you can create one.

A subnet is configured with DHCP by default. When an ECS in this subnet starts, the ECS automatically obtains an IP address using DHCP.


  1. Log in to the management console.
  1. Click in the upper left corner and select the desired region and project.
  2. On the console homepage, under Networking, click Virtual Private Cloud.
  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 Parameter descriptions



    Example Value


    The VPC for which you want to create a subnet.



    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.


    IPv4 CIDR Block

    The CIDR block for the subnet. This value must be within the VPC CIDR block.

    This parameter is displayed only in regions where IPv4/IPv6 dual stack is supported.

    IPv6 CIDR Block

    Specifies whether to set IPv6 CIDR Block to Enable.

    This parameter is displayed only in regions where IPv4/IPv6 dual stack is supported.

    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.


    Advanced Settings/Gateway

    The gateway address of the subnet.

    This IP address is used to communicate with other subnets.

    Advanced Settings/DNS Server Address

    Huawei Cloud private DNS server addresses are entered by default. This allows ECSs in a VPC to communicate with each other and also access other cloud services using private domain names without exposing their IP addresses to the Internet.

    You can change the default DNS server addresses if needed. This may interrupt your access to cloud services.

    You can also click Reset on the right to restore the DNS server addresses to the default value.

    A maximum of two DNS server IP addresses can be configured. Multiple IP addresses must be separated using commas (,).


    Advanced Settings/NTP Server Address

    The IP address of the NTP server. This parameter is optional.

    You can configure the NTP server IP addresses to be added to the subnet as required. The IP addresses are added in addition to the default NTP server addresses. If this parameter is left empty, no IP address of the NTP server is added.

    Enter a maximum of four valid IP addresses, and separate multiple IP addresses with commas. Each IP address must be unique. If you add or change the NTP server addresses of a subnet, you need to renew the DHCP lease for or restart all the ECSs in the subnet to make the change take effect immediately. If the NTP server addresses have been cleared out, restarting the ECSs will not help. You must renew the DHCP lease for all ECSs to make the change take effect immediately.

    Advanced Settings/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.
    • Limited: Set the DHCP lease time. The unit can be day or hour.
    • Unlimited: The DHCP lease time does not expire.

    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.

    365 days

    Advanced Settings/Description

    Supplementary information about the subnet. This parameter is optional.

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


  6. Click OK.


When a subnet is created, there are five reserved IP addresses, which cannot be used. For example, in a subnet with CIDR block, the following IP addresses are reserved:

  • Network ID. This address is the beginning of the private IP address range and will not be assigned to any instance.
  • Gateway address.
  • Reserved for the system interface. This IP address is used by the VPC for external communication.
  • DHCP service address.
  • 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.