CreateRouteEntry_专有网络_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

  • CreateRouteEntry 接口属于异步接口,即系统会返回一个实例 ID,但该路由的添加尚未完成,系统后台的启动任务仍在进行。您可以调用 DescribeRouteEntryList 查询路由的添加状态:
    • 当路由处于 Creating 状态时,表示路由添加中。
    • 当路由处于 Created 状态时,表示路由添加完成。
  • CreateRouteEntry 接口不支持在同一个 VPC 或者同一个 VBR 中并发添加自定义路由条目。
  • CreateRouteEntry 接口在并发情况下可能返回 TaskConflict 错误码,请酌情重试。

使用该接口为 VPC 路由器的路由表添加自定义路由条目时,请注意以下事项:

说明 当添加的路由为前缀列表路由时,路由配额的计算为现存路由与前缀列表路由的最大路由条目数之和是否超过路由配额的限制。
  • 同一个路由表中自定义路由条目不能超过 200 条。

  • 自定义路由条目的目标网段(DestinationCidrBlock)不能和 VPC 内的交换机的网段相同,可以包含交换机的网段但是不能被交换机的网段包含。

  • 自定义路由条目的目标网段(DestinationCidrBlock)可以配置为比云服务系统路由网段100.64.0.0/10更明细的网段,但不支持和该网段相同。

    注意 由于目标网段为100.64.0.0/10的系统路由用于 VPC 内的云产品通信,建议您谨慎配置更明细的路由,如果配置错误将导致云产品服务无法正常访问和使用。

  • 同一路由表下的路由条目的目标网段(DestinationCidrBlock)不允许相同。

  • 如果指定的目标网段(DestinationCidrBlock)是一个 IP 地址,会按照 32 位掩码来处理。

  • 多条自定义路由条目可以指向同一个下一跳(NextHopId)。

  • 自定义路由条目的下一跳(NextHopId)必须和路由表在同一个 VPC。

  • 支持通过 NextHopList 参数配置 ECMP 路由:

    • 添加普通(非 ECMP)自定义路由时,需指定 DestinationCidrBlockNextHopTypeNextHopId 参数,且不能指定 NextHopList 参数。

    • 添加 ECMP 路由时,需指定 DestinationCidrBlockNextHopList 参数,且不能指定 NextHopTypeNextHopId 参数。

使用该接口为边界路由器的路由表添加自定义路由条目时,请注意以下事项:

  • 同一个路由表中自定义路由条目不能超过 200 条。

  • 不支持 NextHopList 参数。

  • 自定义路由条目的目标网段(DestinationCidrBlock)可以配置为比云服务系统路由网段100.64.0.0/10更明细的网段,但不支持和该网段相同。

    注意 由于目标网段为100.64.0.0/10的系统路由用于 VPC 内的云产品通信,建议您谨慎配置更明细的路由,如果配置错误将导致云产品服务无法正常访问和使用。

  • 同一路由表下的路由条目的目标网段(DestinationCidrBlock)不允许相同。

  • 如果指定的目标网段(DestinationCidrBlock)是一个 IP 地址,会按照 32 位掩码来处理。

  • 多条自定义路由条目可以指向同一个下一跳(NextHopId)。

  • 自定义路由条目的下一跳(NextHopId)必须是该 VBR 关联的路由器接口。

  • 只允许在 VBR 状态是 Active,而且对应的物理专线状态是 Enabled 且没有被欠费锁定的情况下在 VBR 上新建路由条目。

  • 仅支持添加普通路由(非 ECMP),需指定 DestinationCidrBlockNextHopTypeNextHopId 参数,且不能指定 NextHopList 参数。

流控信息

请求速率为600/60(s)。更多流控信息,请前往配额中心查看

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
vpc:CreateRouteEntry
Create
RouteTable
acs:vpc:{#regionId}:{#accountId}:routetable/{#RouteTableId}

请求参数

字段名称字段详情
RegionIdstring

路由表所属地域的 ID。展开详情

示例值:cn-hangzhou参考取值来源:
    DescribeRegions
RouteTableIdstring

要添加自定义路由条目的路由表 ID。

示例值:vtb-bp145q7glnuzd****参考取值来源:
    CreateRouteTable
    DescribeRouteTableList
    PublishVpcRouteEntries
DestinationCidrBlockstring

自定义路由条目的目标网段,支持 IPv4、IPv6、前缀列表的目标网段和前缀列表的实例 ID。需满足以下要求:展开详情

示例值:192.168.0.0/24
NextHopIdstring

自定义路由条目的下一跳实例的 ID。

示例值:i-j6c2fp57q8rr4jlu****
ClientTokenstring

客户端 Token,用于保证请求的幂等性。展开详情

示例值:02fb3da4-130e-11e9-8e44-001****
RouteEntryNamestring

要添加的自定义路由条目的名称。展开详情

示例值:test参考取值来源:
    DescribeRouteEntryList
Descriptionstring

自定义路由条目的描述信息。展开详情

示例值:test
NextHopTypestring

自定义路由条目的下一跳的类型,取值: 展开详情

示例值:RouterInterface枚举值:HaVipVpnGatewayGatewayLoadBalancerEndpointVpcPeerInstanceNetworkInterfaceNatGatewayAttachmentIpv4GatewayGatewayEndpointEcrRouterInterfaceIPv6Gateway
NextHopListarray<object>

下一跳的信息。

子级条数 <= 16

返回参数

字段名称字段详情
RouteEntryIdstring

自定义路由条目的 ID。

示例值:rte-sn6vjkioxte1gz83z****
RequestIdstring

请求 ID。

示例值:0ED8D006-F706-4D23-88ED-E11ED28DCAC0

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
IllegalParam.CidrBlock
The specified CidrBlock is illegal.诊断
400
QuotaExceeded
Route entry quota exceeded in this route table.诊断
400
MissingParameter
Miss mandatory parameter.诊断
400
InvalidCidrBlock.Malformed
Specified CIDR block is not valid.诊断
400
InvalidCIDRBlock.Duplicate
Specified CIDR block is already exists.诊断
400
IncorrectVpcStatus
Current VPC status does not support this operation.诊断
400
IncorrectInstanceStatus
Current instance status does not support this operation.诊断
400
IncorrectRouteEntryStatus
Some route entry status blocked this operation.诊断
400
IncorrectVSwitchStatus
The current virtual switch status does not support this operation.诊断
400
InvalidCidrBlock
Specified CIDR block is not valid.诊断
400
InvalidNextHop.NotFound
Specified next hop does not exist.诊断
400
InvalidVRouter.NotFound
vRouter not exists.诊断
400
InvalidVPC.NotFound
vpc not exists.诊断
400
InvalidNexthopTypeAndList.BothNull
both nexthopType and nextHopList are null.诊断
400
InvalidNexthopTypeAndList.BothNotNull
both nexthopType and nextHopList are not null.诊断
400
InvalidRouterInterface
invalid router interface.诊断
400
InvalidOppositeRouterType
nexthop list cannot only contain router interface whose opposite router interface is on vbr.诊断
400
InvalidNexthopListSize
nexthop size is illegal. Must be between 2 and 4.诊断
400
InvalidEntryRuleQuota.NotFound
Route entry quota rule not exists.诊断
400
Forbidden.CheckEntryRuleQuota
Route entry quota rule check error.诊断
400
InvalidVBRStatus
invalid virtual border router status.诊断
400
InvalidPhysicalConnectionBusinessStatus
invalid physical connection business status.诊断
400
InvalidRouterType
Cannot specify nexthop list in vbr's route table.诊断
400
IncorrectHaVipStatus
This operation is denied because satus of the specified HaVip is neither Available nor InUse.诊断
400
CountLimitExceed.HaVipRouteEntry
The count of route entry to HaVip in one route table is exceeded.诊断
400
InvalidRouteEntry.Duplicate
The route entry already exist.诊断
400
InvalidParam
The Ecmp routerEntry with router interfaces local vgw vip not match.诊断
400
INVALID_WEIGHT_PARAM
Specified value of weight invalid诊断
400
FORBIDDEN_USE_VPC_AS_INTERNET_GATEWAY
The Specified CIDR must be in vpc CIDR.诊断
400
InvalidNexthop
The Specified nexthop illegal.诊断
400
INVALID_VPC_ID
The Specified VpcId not match.诊断
400
InvalidRouteEntrySize
The Specified routerEntry size not legal.诊断
400
TaskConflict
The operation is too frequent, please wait a moment and try again.诊断
400
InvalidRouteEntry
Specified routeEntry not exist.诊断
400
InvalidDestinationCidrBlock
The specified destinationCidrBlock must not included in black list cidr.诊断
400
Forbidden.VRouterNotFound
Specified virtual switch is not found during access authentication.诊断
400
DefaultValidate.Error
validte fail.诊断
400
Region.NotSupport
The specified region does not currently support nextHopType for networkInterface诊断
400
OperationFailed.NotifyCenCreate
Failed to notify cen when create route entry.诊断
400
Forbidden.PrivateIpNotFound
Private ip address not exist.诊断
400
OperationUnsupported.InactiveMode
Vpc multi scope route only support active standby.诊断
400
InvalidRouteEntryName.Malformed
Specified RouteEntry name is not valid.诊断
400
IncorrectStatus.MultiScopeRiRouteEntry
MultiScope ri status must not in idle.诊断
400
OperationUnsupported.MoreThanOneVpnOrHavip
MultiScope can not support more than one vpn/havip.诊断
400
OperationUnsupported.EcmpRiTypeOrNumber
Emcp entry not supported if vpc-vbr or vbr-vlan ri does not exist.诊断
400
Duplicated.VpcNextHop
Route entry nexthop duplicate.诊断
400
OperationUnsupported.SubRouteTableECMP
Vpc subRouteTable don't support ecmp or multiScope.诊断
400
InvalidNexthop.NotFound
VRouterEntry nexthop does not exist.诊断
400
IllegalParam.NextHopId
Instance not exists or not vpc vm.诊断
400
QuotaExceeded.HaVipRouteEntry
Vpc havip route entry quota exceed.诊断
400
InvalidNexthop.DirectEni
The direct Eni cannot be nexthop.诊断
400
OperationFailed.InvalidNexthop
vpc multi scope route must has a enable nexthop.诊断
400
OperationFailed.NotifyCenDelete
Failed to notify cen when delete route entry.诊断
400
InvalidNatGateway.NotFound
Natgateway not exist.诊断
400
OperationFailed.CxpRouteExist
Cxp route alreay existed.诊断
400
OperationFailed.GetEniInfo
Failed to get networkInterface info.诊断
400
OperationUnsupported.InvalidRouterInterfaceType
Only vpc vbr interface support ecmp route.诊断
400
InvalidHaVip.NotFound
The specified HaVip does not exist in the specified region.诊断
400
OperationFailed.MultiScopeType
The specified nexthop type is not support in multiScope.诊断
400
OperationFailed.DistibuteLock
Distibute lock fail.诊断
400
QuotaExceeded.VpnRouteEntry
Vpn route entry quota exceeded.诊断
400
InvalidAttachment.NotFound
The attachment is not found.诊断
400
OperationFailed.ActiveNetworkInterfaceNotFound
No active network interface is found on the attachment.诊断
400
InvalidNetworkInterface.NotFound
The network interface is not found on the attachment.诊断
400
OperationFailed.QueryAttachmentInfo
Failed to query attachment information.诊断
400
IllegalParam.AttachmentId
The attachment is invalid.诊断
400
OperationFailed.NotSupportIPV6
The specified next hop does not support IPv6.诊断
400
IncorrectStatus.Ipv6Address
The IPv6 address of the specified next hop is being assigned or deleted.诊断
400
OperationUnsupported.Ipv6EntryOnPrimaryNetworkInterface
You cannot create IPv6 route entries on a primary network interface.诊断
400
OperationUnsupported.SpecifyIpOnIpv6Entry
You cannot specify the private IP address when you create IPv6 route entries.诊断
400
OperationUnsupported.MutipleIpv6Address
You cannot specify a next hop that has bound multiple IPv6 addresses.诊断
400
OperationDenied.Ipv6EntryOnCustomTable
You cannot create any IPv6 route entry on a custom route table.诊断
400
OperationDenied.CloudBoxVbrEntryAllowedInCustomRouteTable
The operation is not allowed because only the custom routing table can add a routing entry with the next hop pointing to the cloud box type VBR.诊断
400
OperationDenied.RouteTableAssociateNotCloudBoxVSwitch
The operation is not allowed because of the routing table is bound to a non-cloud box type vswitch, and routing entries pointing to the cloud box VBR cannot be added.诊断
400
OperationDenied.VbrMisMatchCloudBox
The operation is not allowed because the routing table is bound to a cloud box vswitch, and routing entries pointing to other cloud box VBRs cannot be added.诊断
400
OperationDenied.VbrIdle
The operation is not allowed because the next hop of the added routing entry is a VBR type RI at the opposite end, which cannot be in an idle state.诊断
400
OperationDenied.RouterInterfaceToDifferentVpc
The operation is not allowed because the router interface is connected to different VPCs.诊断
400
OperationDenied.RouterInterfaceFromDifferentZones
The operation is not allowed because the router interface resides in different zones.诊断
400
OperationFailed.PconnTrafficNotEnable
The operation is failed because of PconnTrafficNotEnable.诊断
400
ResourceNotFound.VpcPeer
The specified resource of %s is not found.诊断
400
IncorrectStatus.VpcPeer
The status of %s [%s] is incorrect.诊断
400
OperationDenied.RouteTableTypeNotPermitted
The operation is not allowed because the type of route table is not permitted.诊断
400
OperationDenied.GatewayRouteTableNotPermitted
The operation is not allowed to create a route pointing to this nextHop type on gateway route table.诊断
400
UnsupportedFeature.VpcPeerIpv6
IPv6 route entries for VPC peering connections cannot be created in this region.诊断
400
OperationDenied.VpcIpv6NotEnabled
IPv6 has not been enabled for the VPC.诊断
400
IncorrectStatus.Ipv4Gateway
The status of Ipv4Gateway is incorrect.诊断
400
ResourceNotFound.PrefixList
The specified resource of prefixList is not found.诊断
400
UnsupportedFeature.CreatePrefixListEcmpRouteEntry
The feature of creating ecmp route entry with prefixList is not supported.诊断
400
OperationDenied.RouterInterfaceIpv6NotEnabled
Routerinterface does not support IPv6.诊断
400
OperationDenied.NextHopTypeNotPermitted
The operation is not allowed because the nextHop type is invalid.诊断
400
ResourceAlreadyAssociated.PrefixList
The operation failed because the specified prefixList route entry already exists.诊断
400
OperationFailed.CidrConflictWithPrefixList
The specified CIDR block already exists in a prefixList route entry.诊断
400
ResourceNotFound.Ipv4Gateway
Specified Ipv4Gateway does not exist.诊断
400
Mismatch.HaVipIdAndRouteTableId
The HaVip and RouteTable are mismatched.诊断
400
OperationFailed.OperationLocked
The operation failed because the nextHop instance is in the O&M lock state.诊断
400
Mismatch.Ipv4GatewayIdAndRouteTableId
The specified IPv4Gateway and RouteTable are not matched.诊断
400
OperationUnsupported.DestinationCidrBlockOverlapWithVSwitch
The destination IPv6 network segment specified in the route entry overlaps with the vSwitch network segment.诊断
400
ResourceNotAssociated.Cen
The Vpc and Cen are not associated.诊断
400
IncorrectStatus.CenRelation
The status of Vpc in Cen is incorrect.诊断
400
OperationDenied.CenTypeInvalid
The operation is not allowed because of Cen type is invalid..诊断
400
ResourceNotFound.Cen
The specified resource of Cen is not found.诊断
400
ResourceNotFound.NetworkInterface
The specified resource of network interface is not found.诊断
400
RouteConflict.AlreadyExist
Route conflict exists in routing table.诊断
400
IncorrectStatus.RouterInterface
The specified RouterInterface status is invalid.诊断
400
InvalidNexthop.UnsupportedEniBizType
The biz type of NetworkInterface is illegal.诊断
400
OperationDenied.RouterInterfaceIpv6
RouterInterface does not support IPv6.诊断
400
InvalidNextHopType
Specified parameter "NextHopType" is not valid.诊断
400
OperationDenied.VbrAttachEcrInMiddleStatus
The operation is not allowed because of VBR attach or detach ECR in middle status.诊断
400
ResourceNotAssociated.Ecr
The ECR is not associated.诊断
400
UnsupportedFeature.RouterInterfaceIpv6
The feature of ipv6 is not supported for the routerInterface.诊断
400
InvalidVpnInstanceId.NotFound
The specified VPN was not found.诊断
400
OperationFailed.ScopeActiveRouteEntryType
Operation failed because the type of the active route entry is not supported.诊断
400
OperationFailed.ScopeStandbyRouteEntryQuota
Operation failed because the quota for standby route entries in the scope has been exceeded.诊断
400
OperationFailed.ScopeActiveRouteEntryQuota
Operation failed because the quota for active route entries in the scope has been exceeded.诊断
400
OperationUnsupported.ScopeInvalidRouteType
The specified route type is unsupported.诊断
400
OperationFailed.EcmpInvalidRouterInterfaceOppositeType
Operation failed because the opposite type of the router interface is invalid for ECMP configuration.诊断
400
OperationUnsupported.Ipv6EcmpRouteEntry
The EcmpRouteEntry is not supported for IPv6.诊断
400
OperationUnsupported.Ipv6CidrBlock
The specified IPv6 CIDR block is unsupported.诊断
400
OperationUnsupported.Ipv6ForVBR
IPv6 route entry is not supported for VirtualBorderRouter.诊断
400
IncorrectStatus.RouteTableStatus
The status of the specified RouteTable is incorrect.诊断
400
OperationFailed.InvalidNextHopType
Operation failed because Ecmp routeEntry has more than one ri entry and can only support one non-ri entry.诊断
400
UnsupportedRegion
The feature is not supported in current region.诊断
400
UnsupportedFeature.VpcAdvancedFeature
The VPC does not support some advanced features.诊断
400
OperationDenied.CreateEcmpForPublishedRouteEntry
Operation denied because of can not create EcmpRouteEntry for published RouteEntry.诊断
400
OperationDenied.TrAttachmentIpv6Disabled
The operation is not allowed because tr attachment Ipv6 is disabled.诊断
400
Mismatch.EniIdAndRouteTableId
The operation is not allowed because eni and route table not in same vpc.诊断
403
IncorrectInstanceStatus
The current status of the resource does not support this operation.诊断
404
InvalidParameter
Instance not exists or not vpc vm诊断
404
InvalidNatGatewayId.NotFound
Specified value of NatGatewayId is not found in our record.诊断
404
InvalidInstanId.NotFound
Specified instance does not exist.诊断
404
InvalidNextHopId.NotFound
Specified next hop does not exist.诊断
404
InvalidRouteTableId.NotFound
Specified route table does not exist.诊断
404
InvalidHaVipId.NotFound
The specified HaVip does not exist in the specified VPC.诊断
404
InvalidNetworkInterface.NotFound
The specified networkInterface does not exist.诊断
404
InvalidVpc.NotFound
Specified vpc is not found in our record.诊断
404
OperationFailed.InstanceDismatchCurrentVpc
The specified instance does not exist in current vpc.诊断
404
InvalidIpv6Gateway.NotFound
Specified Ipv6Gateway does not exist.诊断
404
ResourceNotFound.GatewayLoadBalancerEndpoint
GatewayLoadBalancerEndpoint instance not found.诊断
500
VPC.ERROR
error code 500,Internal server error.诊断
500
InternalError
The request processing has failed due to some unknown error, exception or failure.诊断
500
IncorrectStatus.Ipv4Gateway
The status of Ipv4Gateway is incorrect.诊断

变更历史

变更时间变更内容概要操作
2025-01-14
变更错误码400
2024-12-31
变更错误码400
2024-09-13
变更错误码400
2024-09-03
变更错误码400
变更错误码404
2024-08-23
变更错误码400
2024-08-12
变更错误码400

相关示例

VPC 新建自定义路由表->创建路由表规则->绑定到交换机
2021-01-06
添加路由 --> 查询路由
2021-12-16