Help Center> Virtual Private Cloud> User Guide> VPC and Subnet> VPC> Adding a Secondary CIDR Block to a VPC

Adding a Secondary CIDR Block to a VPC

Scenarios

When you create a VPC, you must specify a CIDR block for the VPC. This is the primary CIDR block for your VPC. The primary CIDR block cannot be modified after the VPC is created.

To extend the IP address range of your VPC, you can add a secondary CIDR block.

If you need to create a subnet in the VPC, you can select either the primary or the secondary CIDR block. Similar to the primary CIDR block, if you create a subnet in the secondary CIDR block, a route will be automatically added to your VPC route tables to enable routing within the VPC

This feature is available only in CN East-Shanghai1.

Prerequisites

A VPC has been created.

Notes and Constraints

  • Only one secondary IPv4 CIDR block can be added to each VPC by default.
  • The destination of the route for a subnet in the secondary CIDR block is the subnet CIDR block. The CIDR block must not be the same or larger than a destination CIDR block in a route in any of the VPC route tables.
  • Restricted secondary CIDR blocks:
    • Your primary CIDR blocks or CIDR blocks: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16
    • CIDR blocks that are the same as or fall within reserved private CIDR blocks: 100.64.0.0/10, 214.0.0.0/7, 198.18.0.0/15 and 169.254.0.0/16
    • CIDR blocks that are the same as or fall within reserved public CIDR blocks: 0.0.0.0/8, 127.0.0.0/8, 240.0.0.0/4, and 255.255.255.255/32

Procedure

  1. Log in to the management console.
  1. Click in the upper left corner and select the desired region and project.
  2. On the console homepage, under Network, click Virtual Private Cloud.
  3. In the VPC list, locate the row that contains the VPC to which you want to add a secondary CIDR block and click Edit CIDR Block in the Operation column.
  4. Click Add IPv4 Secondary CIDR Block.
    Figure 1 Add Secondary IPv4 CIDR Block
  5. Enter the secondary CIDR block to add and click OK.