Modifies a specified DNAT entry.

Descriptions

ModifyForwardEntry is an asynchronous operation. After you make a request, the request ID is returned but the specified DNAT entry is not modified. The system modifies the DNAT entry in the background. You can call the DescribeNatGateways operation to query the status of the DNAT entry. The DNAT entry may be in the one of the following states:

  • Pending: indicates that the system is modifying the DNAT entry. You can only query the DNAT entry, but cannot perform other operations.
  • Available: indicates that the DNAT entry is modified.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyForwardEntry

The operation that you want to perform. Set the value to ModifyForwardEntry.

ForwardTableId String Yes ftb-8vbx8xu2lqj9qb334****

The ID of the DNAT table to which the DNAT entry belongs.

ForwardEntryId String Yes fwd-8vbn3bc8roygjp0gy****

The ID of the DNAT entry.

ExternalIp String No 116.85.XX.XX
  • When you modify DNAT entries of Internet NAT gateways, this parameter specifies the elastic IP addresses (EIPs) that are used to access the Internet.
  • When you modify DNAT entries of Virtual Private Cloud (VPC) NAT gateways, this parameter specifies the NAT IP addresses that are accessed by external networks.
ExternalPort String No 80
  • The external port that is used to forward traffic when you modify DNAT entries of Internet NAT gateways.
    • Valid values: 1 to 65535.
    • If you want to modify the port range, separate port numbers with a forward slash (/), such as 10/20.
    • If you want to modify ExternalPort and InternalPort at the same time, and set ExternalPort to a port range, you must also set InternalPort to a port range. For example, you can set ExternalPort to 10/20 and set InternalPor to 80/90.
  • The port that is accessed by external networks when you modify DNAT entries of VPC NAT gateways. Valid values: 1 to 65535.
InternalIp String No 10.0.0.78
  • The private IP address of the ECS instance that uses DNAT entries to communicate with the Internet when you modify DNAT entries of Internet NAT gateways.
  • The private IP address that uses DNAT entries when you modify DNAT entries of VPC NAT gateways.
InternalPort String No 80
  • The internal port or port range that is used to forward traffic when you modify DNAT entries of Internet NAT gateways. Valid values: 1 to 65535.
  • The port of the destination ECS instance to be mapped when you query DNAT entries of VPC NAT gateways. Valid values: 1 to 65535.
IpProtocol String No TCP

The protocol of the packets that are forwarded. Valid values:

  • TCP: TCP
  • UDP: UDP
  • Any: all protocols
ForwardEntryName String No test

The new name of the DNAT entry.

The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://.

RegionId String Yes cn-hangzhou

The ID of the region where the NAT gateway is deployed.

You can call the DescribeRegions operation to query the most recent region list.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Note If you do not set this parameter, the system automatically uses RequestId as ClientToken. RequestId may be different for each API request.
PortBreak Boolean No false

Specifies whether to remove limits on the port range. Valid values:

  • true: yes
  • false (default): no If an SNAT entry and a DNAT entry use the same public IP address, and you want to specify a port number greater than 1024, set PortBreak to true.

Response parameters

Parameter Type Example Description
RequestId String 2315DEB7-5E92-423A-91F7-4C1EC9AD97C3

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ModifyForwardEntry
&ResourceOwnerId=111
&ForwardTableId=ftb-8vbx8xu2lqj9qb334****
&ForwardEntryId=fwd-8vbn3bc8roygjp0gy****
&ExternalIp=116.85.XX.XX
&ExternalPort=80
&InternalIp=10.0.0.78
&InternalPort=80
&IpProtocol=TCP
&ForwardEntryName=test
&RegionId= cn-hangzhou
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&PortBreak=false
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyForwardEntryResponse>
    <RequestId>2315DEB7-5E92-423A-91F7-4C1EC9AD97C3</RequestId>
</ModifyForwardEntryResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HttpCode Error code Error message Description
400 InvalidIp.NotInNatgw The specified Ip not belong to natgateway. The error message returned because the specified IP address does not belong to the NAT gateway.
400 IncorrectStatus.NatIp The status of %s [%s] is incorrect. The error message returned because the status of the NAT IP address is invalid.
400 InvalidExternalIp.Malformed The specified ExternalIp is not a valid IP address. The error message returned because the specified public IP address is invalid.
400 InvalidInternalIp.Malformed The specified InternalIp is not a valid IP address. The error message returned because the specified destination private IP address is invalid.
400 InvalidExternalPort.Malformed The specified ExternalPort is not a valid port. The error message returned because the specified public port is invalid.
400 InvalidInternalPort.Malformed The specified InternalPort is not a valid port. The error message returned because the specified private port is invalid.
400 Forbidden.DestnationIpOutOfVpcCIDR The specified Destination Ip is Out of VPC CIDR. The error message returned because the specified private IP address does not fall within the CIDR block of the VPC. Enter a private IP address that falls within the CIDR block of the VPC.
400 InvalidProtocal.ValueNotSupported The specified IpProtocol does not support. The error message returned because the specified protocol is not supported.
400 IncorretForwardEntryStatus Some Forward entry status blocked this operation.. The error message returned because the operation cannot be performed. The error message returned because one or more DNAT entries in the DNAT table are in the Pending or Modifying state.
400 QuotaExceeded Forward entry quota exceeded in this route table. The error message returned because the number of custom route entries in the same route table cannot exceed 200. Go to the Quota Management page to request a quota increase.
400 Forbidden.ExternalIp.UsedInSnatTable The specified ExternalIp is already used in SnatTable The error message returned because the specified public IP address is already used by an SNAT entry. Select a different IP address or delete the SNAT entry.
400 Forbidden.Already.Bounded The specified instance already bounded The error message returned because the specified instance is associated with another DNAT entry.
400 InvalidParameter.Name.Malformed The specified Name is not valid. The error message returned because the specified name format is invalid. Enter the name in the valid format.
400 InvalidForwardEntryId.NotFound Specified forward entry ID does not exist The error message returned because the specified DNAT entry does not exist.
404 ResourceNotFound.NatIp The specified resource of %s is not found. The error message returned because the specified NAT IP address is not found.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records. The error message returned because the specified region ID does not exist.
404 InvalidExternalIp.NotFound Specified External Ip address does not found on the VRouter The error message returned because the specified public IP address does not exist.
404 InvalidForwardTableId.NotFound Specified forward table does not exist. The error message returned because the specified DNAT table does not exist. Check the parameter and try again.

For a list of error codes, visit the API Error Center.