This topic describes how to create a Destination Network Address Translation (DNAT) entry. Network Address Translation (NAT) Gateway supports DNAT. DNAT maps public IP addresses to private IP addresses of Elastic Compute Service (ECS) instances in a Virtual Private Cloud (VPC) network. This way, ECS instances can receive inbound packets sent over the Internet. DNAT supports port mapping and IP mapping.
- Log on to the NAT Gateway console.
- In the top navigation bar, select the region where the NAT gateway is deployed.
- On the NAT Gateways page, find the target NAT gateway, and click Configure DNAT in the Actions column.
- On the DNAT Table page, click Create DNAT Entry.
- On the Create DNAT Entry page that appears, set the parameters as required, and click OK.
Parameter Description Public IP Address Select an available public IP address.Note If a public IP address is already used in a SNAT entry, it cannot be used in a DNAT entry. Private IP Address Specify the private IP address of the ECS instance that uses the DNAT entry to receive inbound packets sent over the Internet. You can specify the private IP address of the ECS instance in the following ways:
- Auto Fill: select the ECS instance from the ECS instance list or select the Elastic Network Interface (ENI) of the ECS instance from the ENI list.
- Manually Input: enter the private IP address of the ECS instance.
Note The CIDR block of the private IP address must be within that of the VPC network. You can also enter the private IP address of your ECS instance.
Port Settings Select a DNAT mapping method:
- All: IP mapping. All requests destined for the public IP address are forwarded to the target ECS instance.
- Specific Port: port mapping. Requests received on a public port over a protocol are all forwarded
to the specified internal port of the target ECS instance.
After you select Specific Port, specify the Public Port (the external port), Private Port (the internal port), and IP Protocol (the protocol over which inbound packets are sent).
Entry Name Enter a name for the DNAT entry.
The name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.