Creates a CIDR block for a transit router.

Usage notes

You can specify a CIDR block for a transit router. The CIDR block works in a similar way as the CIDR block of the loopback interface on a router. IP addresses within the CIDR block can be assigned to IPsec-VPN connections. For more information, see Transit router CIDR blocks.

The CreateTransitRouterCidr operation can be used to create a CIDR block only after you create a transit router.

The CIDR block must meet the following requirements:

  • Only Enterprise Edition transit routers support custom CIDR blocks.
  • This feature is in pubic preview and is available only in some regions. For more information about the supported regions, see Limits on transit router CIDR blocks.
  • Each transit router supports at most five CIDR blocks. The subnet mask of a CIDR block must be 16 bits to 24 bits in length.
  • The following CIDR blocks and their subnets are not supported: 100.64.0.0/10, 224.0.0.0/4, 127.0.0.0/8, and 169.254.0.0/16.
  • The CIDR block cannot overlap with CIDR blocks that network instances attached to the CEN instance use to communicate with each other.
  • On the same CEN instance, each transit router CIDR block must be unique.
  • When you create the first VPN connection after you add a CIDR block for a transit router, three CIDR blocks within the CIDR block are reserved. An IP address is allocated from the remaining CIDR blocks to the IPsec-VPN connection.

    You can call ListTransitRouterCidrAllocation to query reserved CIDR blocks and IP addresses allocated to network connections.

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 CreateTransitRouterCidr

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

ClientToken String No 123e4567-e89b-12d3-a456-426****

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. ClientToken can contain only ASCII characters.

Note If you do not set this parameter, ClientToken is set to the value of RequestId. The value of RequestId for each API request may be different.
TransitRouterId String Yes tr-p0w3x8c9em72a40nw****

The ID of the transit router.

RegionId String Yes ap-southeast-2

The ID of the region where the transit router is deployed.

You can call the DescribeChildInstanceRegions operation to query the most recent region list.

Name String No nametest

The name of the CIDR block.

The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

Description String No desctest

The description of the CIDR block.

The description must be 2 to 256 characters in length. The description must start with a letter but cannot start with http:// or https://.

DryRun Boolean No false

Specifies whether only to precheck the request. Valid values:

  • true: prechecks the request but does not create the CIDR block. The system checks the required parameters, the request format, and the service limits. If the request fails to pass the precheck, an error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false (default): sends the request. After the request passes the precheck, the CIDR block is created.
Cidr String Yes 192.168.10.0/24

The CIDR block that you want to create for the transit router.

PublishCidrRoute Boolean No true

Specifies whether to allow the system to automatically add a route that points to the CIDR block to the route table of the transit router.

  • true (default): yes

    A value of true specifies that after you create a private VPN connection and enable route learning for the connection, the system automatically adds a blackhole route to the route table of the transit router to which the VPN connection is attached. The destination CIDR block of the blackhole route is the CIDR block of the transit router. The CIDR block of the transit router refers to the CIDR block from which gateway IP addresses are allocated to IPsec-VPN connections. The blackhole route is advertised only to the route table of the virtual border router (VBR) that is connected to the transit router.

  • false: no

Response parameters

Parameter Type Example Description
TransitRouterCidrId String cidr-0zv0q9crqpntzz****

The ID of the transit router CIDR block.

RequestId String 0876E54E-3E36-5C31-89F0-9EE8A9266F9A

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateTransitRouterCidr
&ClientToken=123e4567-e89b-12d3-a456-426****
&TransitRouterId=tr-p0w3x8c9em72a40nw****
&RegionId=ap-southeast-2
&Name=nametest
&Description=desctest
&DryRun=false
&Cidr=192.168.10.0/24
&PublishCidrRoute=true
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateTransitRouterCidrResponse>
    <TransitRouterCidrId>cidr-0zv0q9crqpntzz****</TransitRouterCidrId>
    <RequestId>0876E54E-3E36-5C31-89F0-9EE8A9266F9A</RequestId>
</CreateTransitRouterCidrResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "TransitRouterCidrId" : "cidr-0zv0q9crqpntzz****",
  "RequestId" : "0876E54E-3E36-5C31-89F0-9EE8A9266F9A"
}

Error codes

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