Updated on 2025-07-11 GMT+08:00

VPC

What is a VPC?

The Virtual Private Cloud (VPC) service enables you to provision logically isolated virtual private networks for cloud resources, such cloud servers, containers, and databases. You can customize subnets, security groups, network ACLs, route tables, and assign EIPs and bandwidths as needed. If you need to connect your VPC to an on-premises data center to build a hybrid cloud network, you can use Direct Connect or VPN. Learn more
Figure 1 VPC architecture

Quick Start

You can create a VPC and an ECS to set up an IPv4 private network on the cloud and bind an EIP to the ECS to allow the ECS to access the Internet. Figure 2 shows the architecture of an IPv4 network. In this network, security group sg-A protects ecs-A01 in it.

For details, see Setting Up an IPv4 Network in a VPC.
Figure 2 The architecture of an IPv4 network
  1. Create a VPC with an IPv4 CIDR block and create a subnet in the VPC.
    • VPC IPv4 CIDR block: 192.168.0.0/16
    • Subnet IPv4 CIDR block: 192.168.0.0/24
  2. Buy an ECS in the subnet you have created and configure security group rules for the ECS.
  3. Buy an EIP and bind it to the ECS so that the ECS can access the Internet.
  4. To test ECS connectivity, you can:
    • Log in to the ECS from the local PC.
    • Access the Internet from the ECS using an EIP.

You can create a VPC with an IPv4 and IPv6 CIDR block and create an ECS with both IPv4 and IPv6 addresses in the VPC. You can bind an EIP and add the IPv6 address of the ECS to a shared bandwidth to enable the ECS to communicate with the Internet over both IPv4 and IPv6 networks. Figure 3 shows the architecture of an IPv4/IPv6 dual-stack network. In this network, security group sg-A protects ecs-A01 in it.

For details, see Setting Up an IPv4/IPv6 Dual-Stack Network in a VPC.
Figure 3 The architecture of an IPv4/IPv6 dual-stack network
  1. Create a VPC with an IPv4 CIDR block and create a subnet with IPv6 enabled in the VPC.
    • VPC IPv4 CIDR block: 192.168.0.0/16
    • Subnet IPv4 CIDR block: 192.168.0.0/24
    • Subnet IPv6 CIDR block: In this example, 2407:c080:1200:2075::/64 is assigned.
  2. Buy an ECS in the subnet you have created and configure security group rules for the ECS.
  3. Buy an EIP and bind it to the ECS so that the ECS can communicate with the Internet using an IPv4 address.
  4. Buy a shared bandwidth and add the IPv6 address of the ECS to the shared bandwidth so that the ECS can communicate with Internet using an IPv6 address.
  5. To test ECS connectivity, you can:
    • Log in to the ECS from the local PC through the IPv4 EIP or IPv6 address.
    • Verify whether the ECS can communicate with the Internet over IPv4 and IPv6 networks.

FAQ