全部產品
Search
文件中心

NAT Gateway:ModifyForwardEntry

更新時間:Jun 19, 2026

呼叫ModifyForwardEntry介面修改指定的DNAT條目。

介面說明

  • ModifyForwardEntry 介面屬於異步介面,即系統會先返回一個請求 ID,但 DNAT 條目並未修改完成,系統後台的修改任務仍在進行。您可以呼叫 DescribeForwardTableEntries 查詢 DNAT 條目的狀態:

    • 當 DNAT 條目處於 Pending 狀態時,表示 DNAT 條目正在修改中,在該狀態下,您只能執行查詢操作,不能執行其他操作。

    • 當 DNAT 條目處於 Available 狀態時,表示 DNAT 條目修改完成。

  • ModifyForwardEntry 介面在同一個 DNAT 條目下不支援並發修改指定的 DNAT 條目。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

vpc:ModifyForwardEntry

update

*ForwardTable

acs:vpc:{#regionId}:{#accountId}:forwardtable/{#ForwardTableId}

請求參數

名稱

類型

必填

描述

樣本值

ForwardTableId

string

DNAT 條目所屬的 DNAT 列表的 ID。

ftb-8vbx8xu2lqj9qb334****

ForwardEntryId

string

要修改的 DNAT 條目的 ID。

fwd-8vbn3bc8roygjp0gy****

ExternalIp

string

  • 當修改公網 NAT 閘道的 DNAT 條目時,該參數為提供公網存取的公網 IP 位址。

  • 當修改 VPC NAT 閘道的 DNAT 條目時,該參數為供外部網路存取的 NAT IP 位址。

116.85.XX.XX

ExternalPort

string

  • 當修改公網 NAT 閘道的 DNAT 條目時,該參數為 DNAT 條目中進行連接埠轉發的外部連接埠或連接埠段。

    • 修改的連接埠範圍需要在 1~65535 之間。

    • 如果需要修改連接埠段,請在輸入時以正斜線(/)隔開起始連接埠,例如10/20

    • 如果需要同時修改 ExternalPortInternalPort,而且 ExternalPort 為連接埠段,則 InternalPort 也需要設定為連接埠段,且連接埠段的連接埠個數相同,例如 ExternalPort 設定為10/20InternalPort 設定為80/90

  • 當修改 VPC NAT 閘道的 DNAT 條目時,該參數為被外部網路存取的連接埠,取值範圍:1~65535

80

InternalIp

string

  • 當修改公網 NAT 閘道的 DNAT 條目時,該參數為透過 DNAT 條目進行公網通訊的 ECS 執行個體的私網 IP 位址。

  • 當修改 VPC NAT 閘道的 DNAT 條目時,該參數為需要透過 DNAT 規則進行通訊的私網 IP 位址。

10.0.0.78

InternalPort

string

  • 當修改公網 NAT 閘道的 DNAT 條目時,該參數為 DNAT 條目中進行連接埠轉發的內部連接埠或連接埠段,取值範圍:1~65535

  • 當修改 VPC NAT 閘道的 DNAT 條目時,該參數為需要映射的目標 ECS 執行個體連接埠,取值範圍:1~65535

80

IpProtocol

string

協議類型,取值:

  • TCP:轉發 TCP 協議的封包。

  • UDP:轉發 UDP 協議的封包。

  • Any:轉發所有協議的封包。

TCP

ForwardEntryName

string

修改後的 DNAT 條目名稱。

長度為 2~128 個字元,必須以字母或中文開頭,但不能以http://https://開頭。

test

RegionId

string

NAT 閘道所在的地域 ID。

您可以透過呼叫 DescribeRegions 介面取得地域 ID。

cn-hangzhou

ClientToken

string

用戶端 Token,用於保證請求的冪等性。

從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元。

說明

若您未指定,則系統自動使用 API 請求的 RequestId 作為 ClientToken 標識。每次 API 請求的 RequestId 不一樣。

123e4567-e89b-12d3-a456-426655440000

PortBreak

boolean

是否開啟連接埠突破,取值:

  • true:開啟連接埠突破。

  • false:不開啟連接埠突破。當 DNAT 條目和 SNAT 條目使用同一個公網 IP 位址時,如果您需要設定大於1024的連接埠號,您需要指定PortBreaktrue

false

DryRun

boolean

是否只預檢此次請求。取值:

  • true:傳送檢查請求,不會修改 DNAT 條目。檢查項包括是否填寫了必需參數、請求格式、業務限制。如果檢查不通過,則返回對應錯誤。如果檢查通過,則返回錯誤碼DryRunOperation

  • false(預設值):傳送正常請求,通過檢查後返回 HTTP 2xx 狀態碼並直接修改 DNAT 條目。

false

返回參數

名稱

類型

描述

樣本值

object

請求 ID。

RequestId

string

請求 ID。

2315DEB7-5E92-423A-91F7-4C1EC9AD97C3

樣本

正常返回樣本

JSON格式

{
  "RequestId": "2315DEB7-5E92-423A-91F7-4C1EC9AD97C3"
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 UnsupportedFeature.PortSegment The feature of PortSegment is not supported.
400 ExclusiveParam.%sAnd%s The param of %s and %s are mutually exclusive.
400 InvalidIp.NotInNatgw The specified Ip not belong to natgateway.
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 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 IncorrectStatus.ForwardEntry The status of %s [%s] is incorrect.
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 Destination Ip is Out of VPC CIDR.
400 InvalidProtocal.ValueNotSupported The specified IpProtocol does not support.
400 IncorretForwardEntryStatus Some Forward entry status blocked this operation..
400 QuotaExceeded Forward entry quota exceeded in this route table.
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 Forbidden.Already.Bounded The specified instance already bounded
400 InvalidIp.NotFound The specified ip does not exist.
400 InvalidParameter.Name.Malformed The specified Name is not valid.
400 IncorretStatus.ForwardEntry The Specified forwardEntry is not stable status, can not operation
400 IllegalParam.AnyPortNotZero Any port port must be zero.
400 Duplicated.DestinationPort The specified param DestinationPort is duplicated.
400 InvalidForwardEntryId.NotFound Specified forward entry ID does not exist
400 OperationUnsupported.EipInBinding Create snat entry with eip in associating status is unsupported.
400 QuotaExceeded.ForwardEntrySessionManytoOne The dnat session quota is exceed.
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 ResourceNotFound.ForwardEntry The specified resource of %s is not found.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records.
404 InvalidForwardEntryId.NotFound Specified forward entry ID does not exist
404 InvalidExternalIp.NotFound Specified External Ip address does not found on the VRouter
404 InvalidForwardTableId.NotFound Specified forward table does not exist.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情