Estos contenidos se han traducido de forma automática para su comodidad, pero Huawei Cloud no garantiza la exactitud de estos. Para consultar los contenidos originales, acceda a la versión en inglés.
Centro de ayuda/ Virtual Private Cloud/ Guía del usuario/ VPC y subred/ VPC/ Adding a Secondary CIDR Block to a VPC
Actualización más reciente 2024-08-05 GMT+08:00

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 of your VPC, and it 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 is automatically added to your VPC route table to enable routing within the VPC.

  • Secondary CIDR blocks are now available only in regions CN-Hong Kong, AP-Bangkok, AP-Singapore, AF-Johannesburg, LA-Mexico City1, LA-Mexico City2, LA-Sao Paulo1, and LA-Santiago.
  • If adding a secondary IPv4 CIDR block to a VPC is supported, you can only use APIs to modify the CIDR block of an existing VPC. For details, see the Virtual Private Cloud API Reference.

Notes and Constraints

  • By default, each VPC only can has one secondary IPv4 CIDR block associated.
  • 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.

  • Tabla 1 lists the secondary CIDR blocks that are not supported.
    Tabla 1 Restricted secondary CIDR blocks

    Type

    CIDR Block (Not Supported)

    Primary CIDR blocks and existing CIDR blocks

    • 10.0.0.0/8
    • 172.16.0.0/12
    • 192.168.0.0/16

    Reserved system CIDR blocks

    • 100.64.0.0/10
    • 214.0.0.0/7
    • 198.18.0.0/15
    • 169.254.0.0/16

    Reserved public CIDR blocks

    • 0.0.0.0/8
    • 127.0.0.0/8
    • 240.0.0.0/4
    • 255.255.255.255/32

Procedure

  1. Log in to the management console.
  2. En la página principal de la consola, en Networking, haga clic en Virtual Private Cloud.
  3. En la página Virtual Private Cloud, busque la fila que contiene la VPC que se va a modificar y haga clic en Modify o Edit CIDR Block en la columna Operation.
  4. Click Add Secondary IPv4 CIDR Block.
    Figura 1 Add Secondary IPv4 CIDR Block
  5. Enter the secondary CIDR block and click OK.