Updated on 2024-05-06 GMT+08:00

Creating a VPC

Scenarios

A VPC provides an isolated virtual network for ECSs. You can configure and manage the network as required.

You can create a VPC by following the procedure provided in this section. Then, create subnets, security groups, and assign EIPs by following the procedure provided in subsequent sections based on your actual network requirements.

Procedure

  1. Go to the Create VPC page.
  2. On the Create VPC page, set parameters as prompted.

    A default subnet will be created together with a VPC and you can also click Add Subnet to create more subnets for the VPC.

    Figure 1 Creating a VPC and subnet
    Table 1 VPC parameter descriptions

    Parameter

    Description

    Example Value

    Region

    Select the region nearest to you to ensure the lowest latency possible.

    EU-Dublin

    Name

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

    VPC-test

    IPv4 CIDR Block

    The CIDR block of the VPC. The CIDR block of a subnet can be the same as the CIDR block for the VPC (for a single subnet in the VPC) or a subset of the CIDR block for the VPC (for multiple subnets in the VPC).

    The following CIDR blocks are supported:

    • 10.0.0.0/8-24
    • 172.16.0.0/12-24
    • 192.168.0.0/16-24

    This parameter will be CIDR Block in regions where IPv4/IPv6 dual stack is not supported, and IPv4 CIDR Block if IPv4/IPv6 dual stack is supported.

    192.168.0.0/16

    Enterprise Project

    The enterprise project to which the VPC belongs.

    An enterprise project facilitates project-level management and grouping of cloud resources and users. The name of the default project is default.

    For details about creating and managing enterprise projects, see the Enterprise Management User Guide.

    default

    Advanced Settings

    Click the drop-down arrow to set advanced VPC parameters, including tags.

    Retain the default settings.

    Tag

    The VPC tag, which consists of a key and value pair.

    Each cloud resource can have a maximum of 20 tags.

    • Key: vpc_key1
    • Value: vpc-01

    Description

    Supplementary information about the VPC. This parameter is optional.

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

    N/A

    Table 2 Subnet parameter descriptions

    Parameter

    Description

    Example Value

    AZ

    An AZ is a geographic location with independent power supply and network facilities in a region. AZs are physically isolated, and AZs in the same VPC are interconnected through an internal network. For details, see Region and AZ.

    Note the following when you select an AZ:
    • A VPC can have subnets that are in different AZs. For example, a VPC can have subnet A in AZ 1, and subnet B in AZ 3.
    • A cloud resource and its subnet can be in different AZs. For example, a cloud server in AZ 1 can use a subnet in AZ 3. If AZ 3 becomes faulty, cloud servers in AZ 1 can still use the subnet in AZ 3, and your services are not interrupted.

    AZ1

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

    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.

    192.168.0.0/24

    IPv6 CIDR Block

    Specifies whether to set IPv6 CIDR Block to Enable.

    After the IPv6 function is enabled, 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.

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

    -

    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

    Click the drop-down arrow to set advanced settings for the subnet, including Gateway and DNS Server Address.

    Retain the default settings.

    Gateway

    The gateway address of the subnet.

    This IP address is used to communicate with other subnets.

    192.168.0.1

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

    100.125.x.x

    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.

    After you change the DHCP lease time on the console, the change is applied automatically when the DHCP lease of an instance (such as ECS) is renewed. You can wait for the system to renew the lease or manually renew the lease. Renewing lease will not change the IP address used by the instance. If you want the new lease time to take effect immediately, manually renew the lease or restart the ECS.

    -

    Tag

    The subnet tag, which consists of a key and value pair.

    Each cloud resource can have a maximum of 20 tags.

    • Key: subnet_key1
    • Value: subnet-01

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

    N/A

    Table 3 VPC tag key and value requirements

    Parameter

    Requirements

    Example Value

    Key

    • Cannot be left blank.
    • Must be unique for each VPC and can be the same for different VPCs.
    • Can contain a maximum of 36 characters.
    • Can contain only the following character types:
      • Uppercase letters
      • Lowercase letters
      • Digits
      • Special characters, including hyphens (-) and underscores (_)

    vpc_key1

    Value

    • Can contain a maximum of 43 characters.
    • Can contain only the following character types:
      • Uppercase letters
      • Lowercase letters
      • Digits
      • Special characters, including periods (.), hyphens (-) and underscores (_)

    vpc-01

    Table 4 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 only the following character types:
      • Uppercase letters
      • Lowercase letters
      • Digits
      • Special characters, including hyphens (-) and underscores (_)

    subnet_key1

    Value

    • Can contain a maximum of 43 characters.
    • Can contain only the following character types:
      • Uppercase letters
      • Lowercase letters
      • Digits
      • Special characters, including hyphens (-) and underscores (_)

    subnet-01

  3. Confirm the current configuration and click Create Now.