All Products
Search
Document Center

ENS:CreateForwardEntry

Last Updated:Mar 12, 2024

Adds a Destination Network Address Translation (DNAT) entry to a DNAT table.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
NatGatewayIdstringYes

The ID of the Network Address Translation (NAT) gateway.

nat-5t7nh1cfm6kxiszlttr383xpo
ExternalIpstringYes

The elastic IP address (EIP) that is used to access the Internet.

121.11.36.28
ExternalPortstringYes

The external port or port range that is used for port forwarding.

  • Valid values: 1 to 65535.
  • To specify a port range, separate the first port and the last port with a forward slash (/), such as 10/20.
  • If you set ExternalPort to a port range, you must also set InternalPort to a port range, and the number of ports specified must be the same for both parameters. For example, if you set ExternalPort to 10/20, you can set InternalPort to 80/90.
22
InternalIpstringYes

The private IP address of the instance that uses the DNAT entry for Internet communication.

10.0.0.13
InternalPortstringYes

The internal port or port range that is used for port forwarding.

  • Valid values: 1 to 65535.
  • To specify a port range, separate the first port and the last port with a forward slash (/), such as 10/20.
22
ForwardEntryNamestringNo

The name of the DNAT entry. The name must be 2 to 128 characters in length. The name cannot start with http:// or https://.

test0
IpProtocolstringNo

The protocol. Valid values:

  • TCP: forwards TCP packets.
  • UDP: forwards UDP packets.
  • Any (default): forwards all packets.
Any
HealthCheckPortintegerNo

The probe port. The port must be within the internal port range. By default, this parameter is left empty.

80
StandbyExternalIpstringNo

The secondary EIP that is used to access the Internet. You need to select a secondary EIP that is bound to NAT. After the DNAT entry is created, the secondary EIP takes effect.

101.XXX.XXX.4

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request.

EF6D6FA4-DACA-5822-A981-81006271D263
ForwardEntryIdstring

The ID of the DNAT entry.

fwd-5tc07cw14metghn3siv4ak8do

Examples

Sample success responses

JSONformat

{
  "RequestId": "EF6D6FA4-DACA-5822-A981-81006271D263",
  "ForwardEntryId": "fwd-5tc07cw14metghn3siv4ak8do"
}

Error codes

HTTP status codeError codeError messageDescription
400ens.interface.error An error occurred while call the API. -
400Invalid%sThe specified parameter %s is invalid.-
400Missing%sYou must specify the parameter %s.-
400InvalidParameter.NatNotFoundThe specified Nat is not found.-
400InvalidParameter.ExternalIpThe specified externalIp is not found.-
400Forbidden.ExternalIpUsedInSnatForbidden.ExternalIpUsedInSnat-
400InvalidParameter.InternalIpThe specified parameter internalIp is invalid.-
400InvalidParameter.InternalIpNotFoundThe input parameter internalIp that is not found.-
400InvalidPort.MalformedThe specified port is not a valid port. -
400Forbidden.ExternalPort.DuplicatedThe specified ExternalPort is duplicated.-
400ForwardEntryLimitExceedThe limit of forward entry in the nat reaches.-
400InvalidParameter.HealthCheckPortHealthCheckPort is not in the range of InternalPort-
400IncorrectInstanceStatusThe current status of the instance does not support this operation.The instance is in a state that does not support the current operation.
400SystemBusySystem is busy, please try again later.The system is currently busy, please try again later.
400NoPermissionPermission denied.-
400InvalidParameter.%sThe specified field %s invalid. Please check it again.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-01-23The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
2023-11-16The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
2023-07-18The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: StandbyExternalIp