Updated on 2022-08-18 GMT+08:00

(Optional) 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. Log in to the management console.
  2. On the console homepage, under Network, click Virtual Private Cloud.
  3. Click Create VPC.
  4. 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.

    You can click Advanced Settings to configure advanced subnet parameters.
    Table 1 VPC parameter descriptions

    Parameter

    Description

    Example Value

    Region

    Regions are geographic areas that are physically isolated from each other. The networks inside different regions are not connected to each other, so resources cannot be shared across different regions. For low network latency and quick resource access, select the region nearest to your target users.

    N/A

    Name

    The VPC name

    The name can contain a maximum of 64 characters, including only letters, digits, underscores (_), hyphens (-), and periods (.). Spaces are not allowed.

    VPC-001

    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 – 10.255.255.255

    172.16.0.0 – 172.31.255.255

    192.168.0.0 – 192.168.255.255

    192.168.0.0/16

    Enterprise Project

    When creating a VPC, you can add the VPC to an enabled enterprise project.

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

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

    default

    Tag

    The VPC tag, which consists of a key and value pair. You can add a maximum of ten tags to each VPC.

    • Key: vpc_key1
    • Value: vpc-01
    Table 2 Subnet parameter descriptions

    Parameter

    Description

    Example Value

    Name

    The subnet name.

    The name can contain a maximum of 64 characters, including only letters, digits, underscores (_), hyphens (-), and periods (.). Spaces are not allowed.

    Subnet

    CIDR Block

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

    192.168.0.0/24

    Advanced Settings

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

    Default

    Gateway

    The gateway address of the subnet.

    This IP address is used to communicate with other subnets.

    192.168.0.1

    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.

    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. Unit: Day/Hour

    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

  5. Confirm the current configuration and click Create Now.