CreateForwardEntry_专有网络_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.

接口说明

每条 DNAT 条目由五部分组成,包括 ExternalIpExternalPortIpProtocolInternalIpInternalPort。添加 DNAT 条目后,NAT 网关会将ExternalIp:ExternalPort上收到的指定协议的报文转发给InternalIp:InternalPort,并将回复消息原路返回。

调用本接口添加 DNAT 条目时,请注意:

  • CreateForwardEntry 接口属于异步接口,即系统会先返回一个 DNAT 条目 ID,但该 DNAT 条目并未添加完成,系统后台的添加任务仍在进行。您可以调用 DescribeForwardTableEntries 查询 DNAT 条目的状态:

    • 当 DNAT 条目处于 Pending 状态时,表示 DNAT 条目正在添加中,在该状态下,您只能执行查询操作,不能执行其他操作。

    • 当 DNAT 条目处于 Available 状态时,表示 DNAT 条目添加完成。

  • 所有 DNAT 条目的 ExternalIpExternalPortIpProtocol 三个字段组成的组合必须互不重复,即不允许将同一个源 IP、同一个端口、同一个协议的消息转发到多个目标 ECS 实例。

  • 所有 DNAT 条目的 InternalIpInternalPortIpProtocol 三个字段组成的组合也必须互不重复。

  • 所有 DNAT 条目的 ExternalIpInternalIp 两个字段的 IP 地址不能相同,如果业务需要两个 IP 地址相同, 请联系商务经理。

  • 一个 DNAT 表最多可添加 100 条 DNAT 条目。

  • DNAT 条目中配置了 IP 映射方式的 IP(公网 NAT 网关使用的 EIP 或 VPC NAT 网关使用的 NAT IP 地址)不能再被其他 DNAT 条目或 SNAT 条目使用。

流控信息

当前云产品API请求速率暂未透出。

授权信息

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

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
vpc:CreateForwardEntry
Create
ForwardTable
acs:vpc:{#regionId}:{#accountId}:forwardtable/{#ForwardTableId}

请求参数

字段名称字段详情
RegionIdstring

NAT 网关所在的地域 ID。展开详情

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

DNAT 列表的 ID。

示例值:ftb-bp1mbjubq34hlcqpa****参考取值来源:
    DescribeForwardTableEntries
ExternalIpstring
  • 当为公网 NAT 网关配置 DNAT 条目时,提供公网访问的弹性公网 IP 地址。展开详情
示例值:116.28.XX.XX
ExternalPortstring
  • 当为公网 NAT 网关配置 DNAT 条目时, 需要进行端口转发的外部端口或端口段。展开详情
示例值:8080
InternalIpstring
  • 当为公网 NAT 网关配置 DNAT 条目时,需要进行公网通信的 ECS 实例的私网 IP 地址,该私网 IP 地址需满足以下条件: 展开详情
示例值:192.168.XX.XX
InternalPortstring
  • 当为公网 NAT 网关配置 DNAT 条目时,需要进行端口转发的内部端口或端口段,取值范围:1~65535展开详情
示例值:80
IpProtocolstring

协议类型,取值: 展开详情

示例值:TCP
ForwardEntryNamestring

DNAT 规则的名称。展开详情

示例值:ForwardEntry-1参考取值来源:
    DescribeForwardTableEntries
ClientTokenstring

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

示例值:0c593ea1-3bea-11e9-b96b-88e9fe6****
PortBreakboolean

是否开启端口突破,取值:展开详情

示例值:false
DryRunboolean

是否只预检此次请求,取值:展开详情

示例值:false

返回参数

字段名称字段详情
ForwardEntryIdstring

DNAT 条目的 ID。

示例值:fwd-119smw5tkasdf****
RequestIdstring

请求 ID。

示例值:A4AEE536-A97A-40EB-9EBE-53A6948A6928

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
UnsupportedFeature.PrivateLinkEnabled
The feature of PrivateLinkEnabled is not supported.诊断
400
UnsupportedFeature.PortSegment
The feature of PortSegment is not supported.诊断
400
ExclusiveParam.%sAnd%s
The param of %s and %s are mutually exclusive.诊断
400
DuplicatedParam.InternalPort
The param of %s is duplicated.诊断
400
DuplicatedParam.ExternalPort
The param of %s is duplicated.诊断
400
OperationFailed.AnyPortConfig
Operation failed because any port correspondence any protocol诊断
400
OperationUnsupported.ForwardEntry
Duplicated destination ip port is unsupported.诊断
400
InvalidIp.NotInNatgw
The specified Ip not belong to natgateway.诊断
400
QuotaExceeded.ForwardEntry
The quota of %s is exceeded, usage %s/%s.诊断
400
IncorrectStatus.NatIp
The status of %s [%s] is incorrect.诊断
400
Forbidden.IpHasBeenUsedInSnat
The source ip can't be used. Because it has been used in snat.诊断
400
InvalidExternalIp.Malformed
The specified ExternalIp is not a valid IP address.诊断
400
InvalidInternalIp.Malformed
The specified InternalIp is not a valid IP address.诊断
400
InvalidExternalPort.Malformed
The specified ExternalPort is not a valid port.诊断
400
InvalidInternalPort.Malformed
The specified InternalPort is not a valid port.诊断
400
Forbidden.DestnationIpOutOfVpcCIDR
The specified Internal Ip is Out of VPC CIDR.诊断
400
Forbidden.DestinationIpOutOfVswitchCIDR
The specified Internal Ip is Out of VSwitch CIDR.诊断
400
InvalidProtocal.ValueNotSupported
The specified IpProtocol does not support.诊断
400
IncorretForwardEntryStatus
Some Forward entry status blocked this operation..诊断
400
ForwardEntry.Duplicated
The specified ExternalIp, IpProtocol, ExternalPort,InternalIp, InternalPort is duplicated诊断
400
Forbidden.ExternalIp.UsedInSnatTable
The specified ExternalIp is already used in SnatTable诊断
400
Forbindden
The specified Instance already bind eip诊断
400
Forbidden.InternalIpOutOfVpcCIDR
The specified Internal Ip is Out of VPC CIDR.诊断
400
Invalid.natgwNotExist
The specified natgateway not exist.诊断
400
MissingParameter
Missing mandatory parameter诊断
400
AnyPort.PortMustBeZero
any port port must be zero.诊断
400
InvalidParameter.Name.Malformed
The specified Name is not valid.诊断
400
IncorrectStatus.ForwardEntry
The status of %s [%s] is incorrect.诊断
400
Duplicated.DestinationPort
The specified param DestinationPort is duplicated.诊断
400
OperationUnsupported.EipInBinding
Create snat entry with eip in associating status is unsupported.诊断
400
QuotaExceeded.ForwardEntrySessionManytoOne
The dnat session quota is exceed.诊断
400
TaskConflict
The operation is too frequent, please wait a moment and try again.诊断
400
OperationFailed.DnatPortRangeLimit
The maximum number of port ranges that can be specified is exceeded.诊断
400
IncorrectStatus.NATGW
NATGW status is invalid.诊断
400
OperationFailed.ForwardEntryNotAllowSrcIpEqualDstIp
The source IP of forward entry is not allowed to equal destination IP.诊断
404
ResourceNotFound.NatIp
The specified resource of %s is not found.诊断
404
InvalidRegionId.NotFound
The specified RegionId does not exist in our records.诊断
404
InvalidForwardTableId.NotFound
Specified forward table does not exist.诊断
404
InvalidExternalIp.NotFound
Specified External Ip address does not found on the VRouter诊断
500
System.Error
ERROR SYSTEM ERROR.诊断
500
InternalError
The request processing has failed due to some unknown error.诊断

变更历史

变更时间变更内容概要操作
2024-12-03
新增请求参数DryRun
2024-10-23
变更错误码400
2024-01-18
变更错误码400
2023-06-14
变更错误码400
2023-03-30
变更错误码400
删除返回参数
2023-03-01
新增返回参数
2022-12-02
变更错误码400
2022-11-07
变更错误码400

相关示例

DNAT规则管理,包括创建、修改、查询、删除
2021-12-17