Adds a secondary IPv4 CIDR block to a virtual private cloud (VPC).

API limits

By default, you can add only one secondary IPv4 CIDR block to each VPC. To request a quota increase, submit a ticket.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes AssociateVpcCidrBlock

The operation that you want to perform. Set the value to AssociateVpcCidrBlock.

RegionId String Yes ch-hangzhou

The ID of the region where the VPC is deployed. You can call the DescribeRegions operation to query region IDs.

VpcId String Yes vpc-o6wrloqsdqc9io3mg****

The ID of the VPC.

SecondaryCidrBlock String No 192.168.0.0/16

The secondary IPv4 CIDR block.

You can specify one of the following standard IPv4 CIDR blocks or 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, take note of 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 an existing secondary CIDR block.
Ipv6Isp String No BGP

The Internet service provider (ISP) for IPv6 addresses of the VPC. Valid values:

  • BGP(default): Alibaba Cloud BGP IPv6
  • ChinaMobile: China Mobile (single line)
  • ChinaUnicom: China Unicom (single line)
  • ChinaTelecom: China Telecom (single line)
Note If your Alibaba Cloud account is allowed to activate single-ISP bandwidth, you can set the ISP field to ChinaTelecom, ChinaUnicom, or ChinaMobile.
IpVersion String No IPV4

The version of the IP address. Valid values:

  • IPv4: IPv4 addresses
  • IPV6: IPv6 addresses. If IpVersion is set to IPV6, and SecondaryCidrBlock is not set. You can assign IPv6 addresses to the VPC.

Response parameters

Parameter Type Example Description
RequestId String C1221A1F-2ACD-4592-8F27-474E02883159

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=AssociateVpcCidrBlock
&RegionId=ch-hangzhou
&VpcId=vpc-o6wrloqsdqc9io3mg****
&<Common request parameters>

Sample success responses

XML format

<AssociateVpcCidrBlockResponse>
         <RequestId>C1221A1F-2ACD-4592-8F27-474E02883159</RequestId>
</AssociateVpcCidrBlockResponse>

JSON format

{
	"RequestId":"C1221A1F-2ACD-4592-8F27-474E02883159"
}

Error codes

HttpCode Error code Error message Description
400 InvalidCidrBlock.Malformed Specified CIDR block is not valid. The error message returned because the format of the specified CIDR block is invalid.
403 Forbbiden User not authorized to operate on the specified resource. The error message returned because you are unauthorized to perform this operation on the specified resource. You can apply for the permissions and try again.
400 MissingParam.SecondaryCidrBlockOrIpv6CidrBlock Either SecondaryCidrBlock or Ipv6CidrBlock must be specified. The error message returned because the secondary IPv4 CIDR block or the IPv6 CIDR block is not set.
400 MissingParam.VpcId You must specify VpcId. The error message returned because VpcId is not set.

For a list of error codes, visit the API Error Center.