You need to enable JavaScript to run this app.
文档中心
私有网络

私有网络

复制全文
下载 pdf
路由表
CreateRouteEntry - 创建路由条目
复制全文
下载 pdf
CreateRouteEntry - 创建路由条目
调用 CreateRouteEntry 接口,为路由表添加一条自定义路由条目。​
使用说明​
  • 单个路由表默认最多可创建的自定义路由条目数量为200条。若默认配额无法满足需求,请前往 配额中心 提升相应配额。​
  • CreateRouteEntry 为异步接口,即返回请求ID时,系统后台仍在配置。您可调用 DescribeRouteEntryList 查看路由条目的状态,Pending表示配置中,Available 表示配置完成。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:CreateRouteEntry​
接口名称。当前 API 的名称为CreateRouteEntry。​
​
Version String 必选 示例值:2020-04-01​
接口版本。当前 API 的版本为 2020-04-01。​
​
RouteTableId String 必选 示例值:vtb-2fdzao4h726f45oxruw******​
路由表ID。​
您可以调用 DescribeRouteTableList 接口,查询路由表的ID。​
​
RouteEntryName String 可选 示例值:route-entry-1​
路由条目名称。​
  • 需要以字母、中文或数字开头,可包含点号(.)、下划线(_)和短横线(-)。​
  • 长度限制为1 ~ 128个字符​
  • 不填默认空字符串。​
​
Description String 可选 示例值:This is first route entry​
路由条目描述。​
  • 需要以字母、中文或数字开头。可包含英文逗号(,)、点号(.)、下划线(_)、空格( )、等号(=)、短横线(-)、中文逗号(,)、中文句号(。)。​
  • 长度限制为 0~ 255个字符。​
  • 不填默认空字符串。​
​
NextHopName String 可选 示例值:eni-01​
路由条目下一跳资源的名称。​
​
NextHopType String 必选 示例值:NetworkInterface​
  • 子网路由表:自定义路由条目的下一跳的类型。取值如下:​
  • Instance:ECS实例。​
  • HaVip:高可用虚拟IP。​
  • NetworkInterface:辅助网卡。​
  • NatGW:NAT网关。​
  • VpnGW:VPN网关。​
  • TransitRouter:中转路由器。​
  • IPv6GW:IPv6网关。​
  • CloudConnector:云连接器。​
  • GWLBEndpoint:网关负载均衡终端节点。​
  • 网关路由表:自定义路由条目的下一跳的类型。取值如下:​
  • NetworkInterface:辅助网卡。​
  • GWLBEndpoint:网关负载均衡终端节点。​
说明​
  • 网关负载均衡、云连接器、IPv6网关、网关路由表正在邀测中,如需试用,请联系客户经理。​
  • 自定义子网路由表支持传入GWLBEndpoint。当GWLBEndpoint的目标网段和local路由目标网段相同时,GWLBEndpoint路由生效。​
  • 若网关路由表的参数NextHopType传入GWLBEndpoint,那么DestinationCidrBlock的值允许是子网网段的子集,如/32。​
​
NextHopId String 可选 示例值:eni-2fdzbqxfwrt345oxru******​
下一跳资源ID。​
请根据下一跳类型,传入正确的资源ID。​
​
DestinationCidrBlock String 可选 示例值:8.XX.XX.8/32​
路由条目的目标网段。​
说明​
  • NextHopType配置为“IPv6GW”时,该参数只能配置为::/0。​
  • DestinationCidrBlock 和DestinationPrefixListId两个参数必须且只能传入一个。​
​
DestinationPrefixListId String 可选 示例值:pl-bp1fg655nh68xyz9****​
前缀列表的ID。​
您可以调用 DescribePrefixLists 接口,查询前缀列表的ID。​
说明​
  • DestinationCidrBlock 和DestinationPrefixListId两个参数必须且只能传入一个。​
  • 网关路由表不支持传入此参数。​
​
ClientToken String 可选 示例值:123e4567-e89b-12d3-a456-42665544****​
客户端Token,用于保证请求幂等性。​
  • 由客户端自动生成一个参数值,确保不同请求间该参数值唯一,避免当调用API超时或服务器内部错误时,客户端多次重试导致重复性操作。​
  • 仅支持ASCII字符,且不能超过64个字符。​
  • 若不传入ClientToken,则此次API调用不进行幂等校验。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RouteEntryId String 示例值:rte-3tj9gw2pwq3vj0******​
新添加路由条目的ID。​
​
RequestId String 示例值:2021062415303301022514515207C4****​
请求ID。​
​
​
​
请求示例​
​
GET /?Action=CreateRouteEntry&Version=2020-04-01&RouteTableId=vtb-2fdzao4h726f45oxruw******&DestinationCidrBlock=8.XX.XX.8/32&NextHopType=NetworkInterface&NextHopId=eni-2fdzbqxfwrt345oxru******&RouteEntryName=RouteEntry_1 HTTP/1.1​
Host: vpc.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/vpc/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "2021062415303301022514515207C4****",​
"Action": "CreateRouteEntry",​
"Version": "2020-04-01",​
"Service": "vpc",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "2021062415303301022514515207C4****",​
"RouteEntryId": "rte-3tj9gw2pwq3vj0******"​
}​
}​
​
错误码​
​
状态码​
错误码​
错误信息​
说明​
400​
DryRunOperation​
Exception raised to indicate a successfully authorized action when the DryRun flag is set to true.​
该请求设置为DryRun操作,操作授权已获得许可,但未被实际执行。​
400​
IdempotentParameterMismatch​
Arguments on this idempotent request are inconsistent with arguments used in previous request(s).​
此幂等请求的参数与前一个请求中使用的参数不一致。​
400​
InvalidCidr.Malformed​
The specified cidr block is malformed.​
指定的网段格式不合法。​
400​
InvalidCidrBlock.Reserved​
The specified CidrBlock is reserved for system use.​
该网段已被系统保留,禁止操作。​
400​
InvalidDescription.Malformed​
The specified description is malformed.​
指定的描述格式不合法。请修复描述格式后重试。​
400​
InvalidDescription.Malformed​
The specified description is malformed. Ensure the maximum length of description is 255.​
指定的描述格式不合法。描述长度不能超过255个字符。​
400​
InvalidEni.InvalidStatus​
The specified elastic network interface is not in the correct status for the request.​
指定的弹性网卡所处的状态无法响应该请求。​
400​
InvalidGatewayRouteTablePrefixList.Malformed​
The specified gateway route table does not support prefix list.​
指定的网关路由表不支持前缀列表。​
400​
InvalidGroup.NotExist​
The specified default resource not exist in current route next hop group.​
指定的默认资源在下一跳路由组中不存在。​
400​
InvalidGroupItem.MissingDefault​
The specified route next hop group is missing a default item.​
指定的路由下一跳组中缺少默认条目。​
400​
InvalidGroupResource.TypesInconsistent​
The types of all resources within the RouteNextHopGroup are inconsistent.​
下一跳路由组资源的IP类型不一致。​
400​
InvalidInstanceGroup.InvalidStatus​
The specified instance group is not in the correct status for the request.​
指定的服务器组所处状态无法响应该请求。​
400​
InvalidIpv4Gateway.VpcMismatch​
The specified IPv4 gateway is not attached to the specified VPC.​
指定的IPv4网关与指定的VPC没有关联。​
400​
InvalidName.Malformed​
The specified name is malformed.​
指定的名称格式不合法。请修复名称格式后重试。​
400​
InvalidName.Malformed​
The specified name is malformed. Ensure the maximum length of name is 128.​
指定的名称格式不合法。名称长度不能超过128个字符。​
400​
InvalidParameter.ClientTokenMalformed​
The specified parameter ClientToken is malformed.​
指定的参数ClientToken格式不合法,长度不能超过64个ASCII字符。​
400​
InvalidParameter.IpVersion​
The specified IP version is not supported.​
指定的IP地址类型不支持。​
400​
InvalidPrefixListAssociation.InUse​
The specified prefix list is already associated with the same resource.​
指定的前缀列表已经被同一资源引用。​
400​
InvalidRouteCidr.Malformed​
The specified CIDR is malformed.​
指定的网段不合法。​
400​
InvalidRouteCidr.UnsupportedCidr​
The specified CIDR is not supported, you can change the CIDR to ::/0.​
不支持指定的CIDR地址块,你可以切换为::/0后重试。​
400​
InvalidRouteCidr.UnsupportedIPv6Cidr​
The specified CIDR is not supported. The specified CIDR block is not supported for IPv6.​
不支持指定的CIDR地址块。指定的CIDR地址块不支持IPv6。​
400​
InvalidRouteNextHop.IPv6Only​
The specified next hop only supports IPv6.​
指定的下一跳仅支持IPv6功能。​
400​
InvalidRouteNextHop.Inactive​
The specified next hop does not contain active ECMP members.​
指定的下一跳ECMP中无活跃成员。​
400​
InvalidRouteNextHop.Malformed​
The specified next hop is malformed.​
指定的下一跳不合法。​
400​
InvalidRouteNextHop.Malformed​
The specified next hop is malformed. Next hop not support IPv6.​
指定的下一跳不支持IPv6功能。​
400​
InvalidVpc.EnableIpv6​
Operation failed because IPv6 is not enabled for the VPC.​
指定的VPC尚未开启IPv6。​
400​
InvalidVpc.InvalidStatus​
The specified VPC is not in the correct status for the request.​
指定的VPC所处状态无法响应该请求。​
400​
QuotaExceeded.PrefixListAssociation​
The number of resources a prefix list can be referenced by exceeded quota.​
前缀列表绑定的资源数量超过配额限制。​
400​
QuotaExceeded.RouteEntry​
Route entry of a route table number exceeded quota.​
已达到可创建路由条目的数量上限。​
403​
Forbidden.DualTunnelVpnGatewayRoute​
You are not authorized to perform operations on the specified route of dual tunnel VPN gateway.​
无权限创建双隧道VPN网关路由。​
403​
Forbidden.RouteNextHopType​
You are not authorized to perform operations on the specified route next hop. The specified route next hop type is not allowed to modify instance.​
无权限对指定路由下一跳类型进行操作。指定的路由下一跳类型不允许修改实例。​
403​
Forbidden​
You are not authorized to perform operations on the specified route table. The specified route table is a system route table.​
无权限对指定路由表进行操作。指定的路由表为系统路由表。​
404​
InvalidEniId.NotFound​
The specified elastic network interface does not exist.​
指定的弹性网卡不存在。​
404​
InvalidGroup.NotFound​
The specified RouteNextHopGroup does not exist.​
指定的下一跳路由组不存在。​
404​
InvalidIpv4Gateway.NotFound​
The specified Ipv4Gateway does not exist.​
指定的IPv4网关不存在。​
404​
InvalidPrefixList.NotFound​
The specified prefix list does not exist.​
指定的前缀列表不存在。​
404​
InvalidRouteNextHop.NotFound​
The specified next hop does not exist.​
指定的下一跳不存在。​
404​
InvalidRouteTable.NotFound​
The specified route table does not exist.​
指定的路由表不存在。​
409​
InvalidRouteCidr.Conflict​
The specified CIDR block conflicts with that of another route in your route table.​
指定的CIDR地址块与所属路由表中另一个规则CIDR地址块冲突。​
409​
InvalidRouteCidr.Conflict​
The specified CIDR block conflicts with that of another subnet in your VPC.​
指定的CIDR地址块与所属VPC中另一个子网的CIDR地址块冲突。​
412​
IdempotentProcessing​
The request uses the same client token as a previous one that is still in process.​
幂等请求处理中。​
​
​
最近更新时间:2026.09.23 11:10:37
这个页面对您有帮助吗?
有用
有用
无用
无用