全部产品
Search
文档中心

专有网络 VPC:CreateRouterInterface - 创建路由器接口

更新时间:Aug 28, 2026

调用CreateRouterInterface接口创建路由器接口。

接口说明

调用本接口创建路由器接口时,请注意:

  • 任意两个路由器之间,最多只能存在一对互连的路由器接口。

  • 一个路由器上可以最多创建 5 个路由器接口。

  • 如果账户下存在欠费状态的路由器接口,则无法再创建路由器接口。

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

  • 边界路由器 VBR(Virtual Border Router)只能是连接发起端,并且是已激活状态。

  • 通过本接口可以创建预付费和后付费的路由器接口。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

当前API暂无授权信息透出。

请求参数

名称

类型

必填

描述

示例值

RegionId

string

是

路由器接口所在的地域 ID。

您可以通过调用 DescribeRegions 接口获取地域 ID。

cn-hangzhou

Role

string

是

路由器接口的角色,取值:

  • InitiatingSide:连接发起端。

  • AcceptingSide:连接接收端。

InitiatingSide

OppositeRegionId

string

是

连接接收端所在的地域 ID。

cn-shanghai

Spec

string

是

路由器接口的规格。可用的规格和对应的带宽取值如下:

  • Mini.2:2 Mbps

  • Mini.5:5 Mbps

  • Small.1:10 Mbps

  • Small.2:20 Mbps

  • Small.5:50 Mbps

  • Middle.1:100 Mbps

  • Middle.2:200 Mbps

  • Middle.5:500 Mbps

  • Large.1:1000 Mbps

  • Large.2:2000 Mbps

  • Large.5:5000 Mbps

  • Xlarge.1:10000 Mbps

说明

当 Role 为 AcceptingSide(连接接收端)时,Spec 取值为 Negative 即创建接收端路由器接口时不涉及规格。

Mini.2

RouterType

string

是

路由器接口关联的路由器类型,取值:

  • VRouter:VPC 路由器。

  • VBR:边界路由器。

VRouter

RouterId

string

是

路由器接口关联的路由器 ID。

vbr-m5ebm6g9ptc9mly1c****

OppositeInterfaceId

string

否

对端路由器接口 ID。

ri-2zeo3xzyf38r4urzd****

OppositeRouterId

string

否

对端路由器的 ID。

vrt-bp1lhl0taikrteen8****

OppositeRouterType

string

否

对端路由器接口关联的路由器类型,取值:

  • VRouter:VPC 路由器。

  • VBR:边界路由器。

VRouter

OppositeInterfaceOwnerId

string

否

对端路由器接口的所有者的阿里云账号 ID。

253460731706911258

HealthCheckSourceIp

string

否

健康检查源 IP 地址,必须是本端 VPC 内的一个未被使用的 IP。

说明

物理专线接入场景下可指定该参数。

192.168.0.6

HealthCheckTargetIp

string

否

健康检查目的 IP 地址。

说明

当指定了 HealthCheckSourceIp 后,该参数必填。

192.168.0.8

AccessPointId

string

否

VBR 所属的接入点 ID。

您可以通过调用 DescribeAccessPoints 接口获取物理专线接入点 ID。

说明

物理专线接入场景下需指定该参数。

ap-cn-hangzhou-yh-ts-A

OppositeAccessPointId

string

否

对端所属的接入点 ID。

说明

对端路由器接口位于 VBR 上时需指定该参数,创建路由器接口后无法修改。

ap-cn-shanghai-nt-aligroup-C

Description

string

否

路由器接口的描述信息。

长度为 2~256 个字符,必须以字母或中文开头,但不能以http:// 或https://开头。

abcabc

Name

string

否

路由器接口的名称。

长度为 2~128 个字符,必须以字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-)。

abc

Period

integer

否

购买时长,取值:

  • 当选择按月付费时,取值范围为1~9。

  • 当选择按年付费时,取值范围为1~3。

说明

InstanceChargeType 参数的值为 PrePaid 时,该参数必填。

3

InstanceChargeType

string

否

路由器接口的付费方式,取值:

  • PrePaid:预付费。

  • PostPaid:后付费。

PrePaid

AutoPay

boolean

否

是否自动付费,取值:

  • false(默认值):不开启自动付费,生成订单后需要到订单中心完成支付。

  • true:开启自动付费,自动支付订单。

说明

InstanceChargeType 参数的值为 PrePaid 时,该参数必填。

false

PricingCycle

string

否

预付费的计费周期,取值:

  • Month(默认值):按月付费。

  • Year:按年付费。

说明

InstanceChargeType 参数的值为 PrePaid 时,该参数必填。

Month

ClientToken

string

否

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

由客户端生成该参数值,要保证在不同请求间唯一。

说明

若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。

123e4567-e89b-12d3-a456-426655440000

ClientToken

string

否

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

由客户端生成该参数值,要保证在不同请求间唯一。

说明

若您未指定,则系统自动使用 API 请求的 RequestId 作为 ClientToken 标识。每次 API 请求的 RequestId 可能不一样。

123e4567-e89b-12d3-a456-426655440000

FastLinkMode

boolean

否

是否为使用快速连接模式创建的 VBR 上联路由器接口,快速连接模式可实现 VBR 和 VPC 两端路由器接口创建完毕后自动完成连接。取值:

  • true:是。

  • false(默认值):否。

说明
  • 该参数只在 RouterType 取值为 VBR,OppositeRouterType 参数取值为 VRouter 时生效。

  • 当 FastLinkMode 参数取值为 true 时,Role 参数必须取值为 InitiatingSide,AccessPointId、OppositeRouterType、OppsiteRouterId 和 OppositeInterfaceOwnerId 参数为必选。

false

AutoRenew

boolean

否

是否开通自动续费。取值:

  • false(默认值):不开通。

  • true:开通。

false

ResourceGroupId

string

否

资源组 ID。

关于资源组的更多信息,请参见什么是资源组。

rg-acfmxazb4ph6aiy****

Tags

array<object>

否

资源的标签。

object

否

标签。

Key

string

否

资源的标签键。至少输入 1 个标签键,最多支持输入 20 个标签键。如需传入该值,则不能输入空字符串。

一个标签键最多支持 128 个字符,不能以aliyun和acs:开头,不能包含http://或者https://。

FinanceDept

Value

string

否

资源的标签值。最多支持输入 20 个标签值。如果传入该值,可以输入空字符串。

最多支持 128 个字符,不能以aliyun和acs:开头,不能包含http://或者https://。

FinanceJoshua

返回参数

名称

类型

描述

示例值

object

请求 ID。

RequestId

string

请求 ID。

079874CD-AEC1-43E6-AC03-ADD96B6E4907

OrderId

integer

订单号,选择预付费时返回该参数。

20210101123456

RouterInterfaceId

string

路由器接口的 ID。

ri-2ze7fbuohm****

示例

正常返回示例

JSON格式

{
  "RequestId": "079874CD-AEC1-43E6-AC03-ADD96B6E4907",
  "OrderId": 20210101123456,
  "RouterInterfaceId": "ri-2ze7fbuohm****"
}

错误码

HTTP status code

错误码

错误信息

描述

400 InvalidPrice.NotFound Pricing plan result not found. Price参数无效
400 InvalidAliuid Invalid Aliuid. Aliuid无效
400 InvalidRole.ValueNotSupported The specified Role is not valid.
400 InvalidSpec.ValudNotSupported The specified Spec is not supported.
400 InvalidRouterType.ValueNotSupported The specified RouterType is not valid.
400 InvalidName.Malformed The specified "Name" is not valid.
400 Forbidden.BillsOutstanding You cannot create more RouterInterface because you have bills outstanding.
400 LimitationExceed.InterfaceNumberOnRouter Total number of RouterInterfaces on a Router exceeded.
400 Forbidden.NotInRouterInterfaceCreateWhitelist Not in router interface create whitelist.
400 RI_CREATE_ONE_LIMIT_BY_SYNC Create ri only one limit by sync.
400 InvalidAccessPoint.ValueNotAllowed The non-vbr router interface cannot have access point configured.
400 InvalidParam.NotFound Parameter must not be null,uid, bid,regionNo, remoteRegionNo, routerId or accessPointId 参数不能为null
400 InvalidAccessPoint.NotMatch The accessPoint id is not matched
400 InvalidAccessPoint.NotExist The accessPoint not exit
400 INVAID_VBR_STATUS VBR status must be active
400 IncorrectStatus.CenStatus Cen status must not be middle status. 请检查cen 状态
400 Forbidden.AcceptRoleNotSupportPrePay Acception side ri not support chargetype for prepaid. 不支持预付费的费用类型。
400 InvalidRouterInterfaceSpec.Malformed Specified RouterInterface spec is not valid. 指定的RouterInterface Spec无效。
400 VpcSubnet.NotFound Vpc subnet not exist. Vpc子网不存在。
400 IllegalParam.HealthcheckIp Healthcheck ip cannot equal with instance ip. Healthcheck ip不能与实例ip相等。
400 OperationFailed.HcForInvalidRiType Healthchecksourceip and healthchecktargetip is only valid for vr ri that is connected to vbr. 健康检查IP无效
400 OperationFailed.SyncOrderToSub SyncOrderToSub error. 操作失败
400 IllegalParam.CrossBorderBandwidth CrossBorder bandwidth error. 跨域带宽包不合法
400 IllegalParam.VRouterType The VRouterType is not supported. VRouterType不合法
400 IllegalParam.Spec The spec is illegal. spec不合法
400 Forbidden.CrossBorder User not authorized to create cross border routerInterface. 用户无权创建跨境routerInterface
400 InvalidRouterId.NotFound Param is not valid,this user does not have this router or aliuid bid regionNo and routerId must have something wrong. RouterId参数无效
400 InvalidCommodity.NotFound Commodity is not exist. Commodity不存在
400 InvalidRouterInterfaceChargeType.Malformed Specified RouterInterface ChargeType is not valid. 指定的RouterInterface ChargeType无效。
400 IllegalParam.RegionId The specified regionId is illegal. regionId不合法
400 PAY.MAYI_WITHHOLDING_AGREEMENT_ILLEGAL User withhoding argeement is illegal.
400 QuotaExceeded RiPerUser quota exceeded 当前用户建立的对等连接路由器接口数量已达上限
400 OperationFailed.PconnTrafficNotEnable The operation is failed because of PconnTrafficNotEnable. 操作失败,因为出方向流量未开通。
400 InvalidRegionId.NotFound The regionId provided does not exist in ec region list. 提供的regionId无效,请检查。
400 ResourceNotInResourceGroup The specified resource is not in the specified ResourceGroup. 输入的资源不在输入的资源组内
400 HaveConnectionBetweenRouters Have connection between routers 两个路由器之间已经创建了连接
400 InvalidDescription.Malformed The specified "Description" is not valid. 描述的长度可以是2到256个字符,不能以http://和https://开头。
400 InvalidBandwidth.NotEnough Bandwidth not enough. 带宽计划的带宽不足。
400 ForbiddenAction The user does not support this action. 您没有所需的权限。
400 OperationFailed.NotSupportIPv6 Router interface not support IPv6. 路由接口不支持IPv6。
400 InvalidParam.AvailableZoneId The specified AvailableZoneId did not retrieve the corresponding cluster IP address. 您指定的AvailableZoneId没有获取到对应的集群IP地址。
400 OperationFailed.NoAvailableAmount The available amount of your account is less than 0, please recharge before attempting to purchase. 您的账户可用额度小于0,请先充值后再尝试购买。
400 OperationFailed.OperationLocked Operation failed because OperationLocked. 操作失败因为实例已经被运维锁定。
400 OperationFailed.InvalidEcGrant The VBR have no grant to create EC. VBR 实例未获得 VPC 实例授权 ,请授权后重试。
400 OperationFailed.CannotConnectOtherOwnerInstance Can not connect with other owner VPC or CEN. 当前资源与其它账号 VPC 或 CEN 绑定失败,请核对是否有相关权限后重试。
400 InvalidParams.NotNull params must not null. 参数不能为空
404 InvalidRegionId.NotFound The regionId provided does not exist in our records. 指定的RegionId不存在。请检查该参数是否正确。
404 InvalidRouterId.NotFound The specified RouterId does not exist in our recored.
404 InvalidRouterId.AttacedToCEN Can not create ri when attaced to CEN. ri不能附加cen

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。