Updated on 2024-08-07 GMT+08:00

Modifying a Subnet

Scenarios

Modify the subnet name, NTP server address, and DNS server address.

Notes and Constraints

After a subnet is created, its AZ cannot be changed.

Procedure

  1. Log in to the management console.
  1. Click in the upper left corner and select the desired region and project.
  2. Click in the upper left corner and choose Networking > Virtual Private Cloud.

    The Virtual Private Cloud page is displayed.

  3. In the navigation pane on the left, choose Virtual Private Cloud > Subnets.

    The Subnets page is displayed.

  4. In the subnet list, locate the target subnet and click its name.

    The subnet details page is displayed.

  5. On the Summary tab, click on the right of the parameter to be modified and modify the parameter as prompted.
    Table 1 Parameter descriptions

    Parameter

    Description

    Example Value

    Name

    The subnet name. The name:
    • Can contain 1 to 64 characters.
    • Can contain letters, digits, underscores (_), hyphens (-), and periods (.).

    Subnet

    DNS Server Address

    By default, two DNS server addresses are configured. You can change them as required. A maximum of two DNS server addresses are supported. Use commas (,) to separate every two addresses.

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

    100.125.x.x

    Domain Name

    Enter domain names (), separated with spaces. A maximum of 254 characters are allowed. A domain name can consist of multiple labels (max. 63 characters each).

    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.

    NOTE:
    The command for updating the DHCP configuration depends on the ECS OS. The following commands are for your reference.
    • Restart the DHCP Client service: service dhcpd restart
    • Restart the network service: service network restart

    test.com

    DHCP Lease Time

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

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

    For details, see How Do I Make the Changed DHCP Lease Time of a Subnet Take Effect Immediately?

    -

    IPv4 DHCP Lease Time

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

    You can set the DHCP lease time of an IPv4 address.

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

    For details, see How Do I Make the Changed DHCP Lease Time of a Subnet Take Effect Immediately?

    -

    IPv6 DHCP Lease Time

    This parameter is displayed in the region where the IPv4/IPv6 dual stack is supported and when IPv6 is enabled.

    You can set the DHCP lease time of an IPv6 address. You can set the DHCP lease time of an IPv6 address in the same way as how you do with an IPv4 address.

    -

    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 you do not specify this parameter, no additional NTP server IP addresses will be added.

    A maximum of four unique NTP server IP addresses can be configured. Multiple IP addresses must be separated by a comma (,). 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.

    192.168.2.1

    Description

    Supplementary information about the subnet. This parameter is optional.

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

    -