You need to enable JavaScript to run this app.
Virtual Private Cloud

Virtual Private Cloud

Copy page
Download PDF
Getting Started
Building an IPv4 VPC
Copy page
Download PDF
Building an IPv4 VPC
Scenarios​
This topic describes how to quickly configure and use an IPv4 network.​
​​​
Configuration procedures​
tip​
The following section only covers essential parameters and their recommended values. For all parameters not explicitly discussed, retain the default settings unless otherwise required by your specific use case.​
Step 1: Create the VPC and subnet​
You can refer to the following operations to create one VPC and two subnets.​
  1. Log in to the VPC console.​
  1. In the top menu bar, select your target region.​
  1. Click Create VPC.​
  1. Configure parameters based on the table below.​
  • ​
    Parameters​
    Notes​
    Sample value​
    Basic information​
    ​
    ​
    Region​
    Select the region of the VPC.​
    China (Beijing)​
    Name​
    Enter the name of the VPC.​
    vpc-01​
    CIDR block​
    ​
    ​
    IPv4 CIDR​
    Set the VPC's IPv4 CIDR block.​
    warning​
    After creation, the CIDR block of the VPC cannot be modified.​
    192.168.0.0/16​
    Subnet​
    ​
    ​
    Zone​
    Select an Availability Zone.​
    AZ-A​
    Name​
    Type in the name of the subnet.​
    Subnet-A​
    IPv4 CIDR​
    Configure the subnet CIDR block, which must fall within the VPC’s address range.​
    Be cautious:​
    After creation, the CIDR block of the subnet cannot be modified.​
    192.168.1.0/24​
    ​
  1. Click Create to complete the action.​
Step 2: Create ECS and associate an EIP​
You can follow these steps to create ECS-A.​
  1. In the left-side navigation pane, click Quick Links > ECS.​
  1. Click Create instance to begin configuring your ECS instance.​
  1. Follow the interface prompts to complete ECS configuration step-by-step, including base configuration, network & security, and advanced settings. Specific configurations are detailed in the table below.​
  • ​
    Parameters​
    Notes​
    Sample value​
    Billing method​
    ECS billing method.​
    Pay-as-you-go​
    Region and AZ​
    Select the region and availability zone for the ECS. The region must match the VPC region, and the availability zone must match the subnet's availability zone.​
    China (Beijing) Availability Zone A​
    Image​
    Images provide ECSs with pre-configured operating systems and essential application data.​
    CentOS 7.9​
    VPC​
    Select the created VPC.​
    vpc-01|192.168.0.0/16​
    Subnet​
    Choose a subnet under the selected VPC.​
    Subnet-A | 192.168.1.0/24​
    EIP​
    Enable this option to automatically assign an EIP during ECS creation, providing Internet access capabilities.​
    • ISP: Supports BGP (Multi-ISP).​
    • Metering method: The EIP Metering method is the same as that of the ECS instance. In this example, it is Pay-as-you-go. Pay-as-you-go EIP addresses support billing by bandwidth cap and pay-by-data-transfer.​
    • Bandwidth cap: The maximum bandwidth for EIP, measured in Mbps.​
    • ISP: BGP (Multi-ISP)​
    • Billing method: Pay-by-data-transfer​
    • Bandwidth cap: 5Mbps​
    Security group​
    This topic selects the default security group "Default" in vpc-01 to control inbound and outbound traffic for the primary network interface of ECSs.​
    Default​
    ​
  1. Click Next: Confirm.​
  1. Follow the console guidance to review and accept the legal terms.​
  1. Click Buy now to redirect to the purchase submitted page.​
  1. Click Go to console to redirect to the Instances page and view the new instance.​
ECS is now successfully created with an EIP assigned by default, enabling bidirectional internet access.​
Step 3: View/Allow security group​
View the ECS's security group and allow required traffic.​
tip​
The default security group automatically allows private network communication between ECSs within the same group and outbound internet access. For demonstration purposes, this topic uses inbound port 80 access as an example. Please adjust configurations according to your actual requirements.​
  1. Log in to the ECS console.​
  1. In the top menu bar, select your target region.​
  1. In the left-side navigation pane, click Instances.​
  1. Click the name of ECS-A.​
  1. On the Security Group tab, you can view the current rule status.​
  1. Click Configure on the right side of the target security group.​
  1. On the Inbound rule tab, click Add rule. Configure the relevant parameters according to the table below.​
  • ​
    Parameters​
    Notes​
    Sample value​
    Priority​
    Set the priority of security group rules.​
    1​
    Policy​
    Select the Security Group policy.​
    Allow​
    Protocol type​
    Select the protocol for the security group.​
    TCP​
    Port range​
    Limit the port range based on different protocol types.​
    80​
    Source​
    Type in the IP address or CIDR block allowed to access ECSs within the security group.​​​
    0.0.0.0/0​
    ​
  1. Click Confirm to complete the action.​
Verify​
  1. Remotely log in to ECS-A.​
  1. Execute the ping 8.8.8.8 command in the command line.​
  • ​​​
​
Last updated: 2026.07.01 10:08:52