nav-img
Advanced

Adding a Secondary IPv4 CIDR Block to a VPC

Scenarios

When you create a VPC, you specify a primary IPv4 CIDR block for the VPC. This CIDR block cannot be changed. To extend the IP address range of your VPC, you can add a secondary CIDR block to the VPC.

Notes and Constraints

  • You can allocate a subnet from either a primary or a secondary CIDR block of a VPC. A subnet cannot use both the primary and the secondary CIDR blocks.

    Subnets in the same VPC can communicate with each other by default, even if some subnets are allocated from the primary CIDR block and some are from the secondary CIDR block of a VPC.

  • If a subnet in a secondary CIDR block of your VPC is the same as or overlaps with the destination of an existing route in the VPC route table, the existing route does not take effect.

    If you create a subnet in a secondary CIDR block of your VPC, a route (the destination is the subnet CIDR block and the next hop is Local) is automatically added to your VPC route table. This route allows communications within the VPC and has a higher priority than any other routes in the VPC route table. For example, if a VPC route table has a route with the VPC peering connection as the next hop and 100.20.0.0/24 as the destination, and a route for the subnet in the secondary CIDR block has a destination of 100.20.0.0/16, 100.20.0.0/16 and 100.20.0.0/24 overlaps and traffic will be forwarded through the route of the subnet.

  • Table 1 provides you with IP address ranges that cannot be used as secondary IPv4 CIDR blocks. For example, the CIDR block 192.168.0.0/16 has IP addresses from 192.168.0.0 to 192.168.255.255, indicating that none of the IP addresses can be included in a secondary IPv4 CIDR block, for example, 192.168.0.0/16, 192.168.31.0/24, 192.168.100.0/24, and 192.168.255.255/32.
    Table 1 IP address ranges that cannot be used as secondary IPv4 CIDR blocks

    Type

    CIDR Block

    IP Address Range

    Reserved private CIDR blocks

    172.31.0.0/16

    172.31.0.0-172.31.255.255

    192.168.0.0/16

    192.168.0.0–192.168.255.255

    In-use primary CIDR blocks

    -

    Reserved system CIDR blocks

    100.64.0.0/10

    100.64.0.0–100.127.255.255

    214.0.0.0/7

    214.0.0.0–215.255.255.255

    198.18.0.0/15

    198.18.0.0–198.19.255.255

    169.254.0.0/16

    169.254.0.0–169.254.255.255

    Reserved public CIDR blocks

    0.0.0.0/8

    0.0.0.0-0.255.255.255

    127.0.0.0/8

    127.0.0.0–127.255.255.255

    240.0.0.0/4

    240.0.0.0–255.255.255.255

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and choose Network > Virtual Private Cloud.

    The Virtual Private Cloud page is displayed.

  3. In the VPC list, locate target VPC and click Edit CIDR Block in the Operation column.

    The Edit CIDR Block dialog box is displayed.

  4. Click Add Secondary IPv4 CIDR Block.

    For example, if the primary CIDR block of a VPC is 192.168.0.0/16, you can add secondary CIDR blocks 10.1.0.0/16, 10.2.0.0/16, 172.16.0.0/16, or 172.17.0.0/16 as a secondary CIDR block.

  5. Enter a secondary CIDR block and click OK.