This topic describes how to expand a virtual private cloud (VPC) by adding a secondary IPv4 CIDR block to the VPC.

Prerequisites

A VPC is created. For more information, see Create a VPC.

Background information

When you create the VPC, the IPv4 CIDR block you specified is the primary CIDR block. After the VPC is created, the primary IPv4 CIDR block of the VPC cannot be modified. However, you can add a secondary IPv4 CIDR block to expand the VPC. After you add the secondary IPv4 CIDR block, both the primary and secondary IPv4 CIDR blocks are in effect. You can create a VSwitch with the primary CIDR block or secondary CIDR block. However, each VSwitch belongs to only one VPC CIDR block.

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.

Secondary IPv4 CIDR block
Note You can add only one secondary IPv4 CIDR block to a VPC and you cannot increase the quota.

Procedure

  1. Log on to the VPC console.
  2. In the top navigation bar, select the region where the VPC is deployed.
  3. On the VPC page, find the VPC that you want to manage, and click Manage in the Actions column.
  4. On the VPC details page, click CIDRs, and then click Add IPv4 CIDR.
  5. 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:
    • 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.

    When you add a secondary IPv4 CIDR block, note the following rules:
    • 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.
      • 192.168.0.0/16.
      • A smaller CIDR block that overlaps with 192.168.0.0/16, such as 192.168.0.0/24.

What to do next

Create a VSwitch