This topic describes how to expand your Virtual Private Cloud (VPC) networks by adding secondary IPv4 address ranges (CIDRs) to your VPCs.

Prerequisites

Before adding a secondary IPv4 CIDR block, make sure that you have completed the following actions:
  • Currently, this feature is only available for whitelisted users. If you want to use this feature, open a ticket.
  • A VPC is created. For more information, see Create a VPC.

Background information

The IPv4 CIDR block configured when the VPC is created is the primary IPv4 CIDR block of the VPC. After a VPC is created, you cannot modify the primary IPv4 CIDR block of the VPC. However, you can add an IPv4 CIDR block to expand the CIDR block of the VPC. After adding the secondary IPv4 CIDR block, the primary IPv4 CIDR block and the secondary IPv4 CIDR block take effect at the same time. You can create VSwitches by using the primary CIDR block or the 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 a primary or secondary CIDR block. The destination CIDR block of a VSwitch route is the CIDR block used by the VSwitch. The CIDR block range must not be the same as or greater than that of other routes in the route table of the VPC.

For example, if you have added 172.16.0.0/16 to the VPC as a secondary IPv4 CIDR block, the VPC route table already contains CEN routes (overlapping routing is enabled), and the destination CIDR block is 172.16.0.0/24, you cannot create a CIDR block of the same or larger range as the CIDR block of the VSwitch. However, you can create a CIDR block 172.16.0.0/25 or a smaller range as the CIDR block of the VSwitch.

Add a secondary IPv4 CIDR block
Note By default, you can only add one secondary IPv4 CIDR block to a VPC. To increase quota, open a ticket.

Procedure

  1. Log on to the VPC console.
  2. Select the region of the target VPC.
  3. On the VPCs page, find the target VPC, click Manage in the Actions column.
  4. On the VPC Details page, click the CIDR tab, then click Add IPv4 CIDR.
  5. On the Add IPv4 CIDR page, configure the CIDR block according to the following information, and then click OK.
    Configuration Description
    VPC Displays the VPC to which you want to add an IPv4 CIDR block.
    Secondary CIDR Select a method to configure the secondary CIDR block:
    • Default CIDR Block: Select a standard CIDR block from 192.168.0.0/16, 172.16.0.0/12, and 10.0.0.0/8.
    • Custom CIDR Block: Use the standard CIDR block 192.168.0.0/16, 172.16.0.0/12, or 10.0.0.0/8 or their subnets.

      If you want to add a CIDR block of public IP addresses as the secondary IPv4 CIDR block to a VPC, open a ticket.

    Note the following limits when adding a secondary IPv4 CIDR block:
    • The CIDR block cannot start with 0. The mask length ranges from 8- to 24-bit.
    • The secondary CIDR block cannot overlap with the primary CIDR block of the VPC or other added secondary CIDR blocks.
      For example, in a VPC with the primary IPv4 CIDR block 192.168.0.0/16, you cannot add the following CIDR block as a secondary IPv4 CIDR block.
      • A CIDR block larger than 192.168.0.0/16, for example, 192.168.0.0/8.
      • The same CIDR block as 192.168.0.0/16.
      • A CIDR block smaller than 192.168.0.0/16, for example, 192.168.0.0/24.

What to do next

Create a VSwitch