This topic describes how to expand a virtual private cloud (VPC) by adding a secondary IPv4 CIDR block to the VPC.
The system automatically adds a VSwitch route to the VPC route table when you create a VSwitch with the primary or secondary CIDR block. The destination CIDR block of a VSwitch route is the CIDR block with which the VSwitch is created. The CIDR block range cannot be the same as or larger than those of other routes in the route table of the VPC.
For example, you have added 172.16.0.0/16 to the VPC as a secondary IPv4 CIDR block. The VPC route table already contains Cloud Enterprise Network (CEN) routes (overlapping routing is enabled), and the destination CIDR block is 172.16.0.0/24. In this case, you cannot create a VSwitch with a CIDR block that is the same or larger than the CIDR block 172.16.0.0/24. However, you can create a VSwitch with 172.16.0.0/25 or a smaller CIDR block.
- Log on to the VPC console.
- In the top navigation bar, select the region where the VPC is deployed.
- On the VPC page, find the VPC that you want to manage, and click Manage in the Actions column.
- On the VPC details page, click CIDRs, and then click Add IPv4 CIDR.
- In the Add Secondary CIDR dialog box, configure the secondary IPv4 CIDR block based on the following parameters
and click OK.
Parameter Description VPC The VPC to which you want to add the secondary IPv4 CIDR block. Secondary CIDR Select a method to configure the secondary IPv4 CIDR block:
When you add a secondary IPv4 CIDR block, note the following rules:
- Default CIDR Block: You can specify one of the following standard IPv4 CIDR blocks as the secondary IPv4 CIDR block: 192.168.0.0/16, 172.16.0.0/12, and 10.0.0.0/8.
- Custom CIDR Block: You can specify one of the following standard IPv4 CIDR blocks and their subnets
as the secondary IPv4 CIDR block: 192.168.0.0/16, 172.16.0.0/12, and 10.0.0.0/8.
To use a public CIDR block as the secondary IPv4 CIDR block,submit a ticket.
- The CIDR block cannot start with 0. The subnet mask must be 8 to 24 bits in length.
- The secondary CIDR block cannot overlap with the primary CIDR block or other secondary
CIDR blocks of the VPC.
For example, if the primary IPv4 CIDR block of a VPC is 192.168.0.0/16, you cannot specify the following CIDR blocks as secondary IPv4 CIDR blocks:
- A larger CIDR block that overlaps with 192.168.0.0/16, such as 192.168.0.0/8.
- A smaller CIDR block that overlaps with 192.168.0.0/16, such as 192.168.0.0/24.