This topic describes how to configure DNAT on an Internet NAT gateway. DNAT allows Elastic Compute Service (ECS) instances to provide Internet-facing services.
Scenarios

Prerequisites
- An Alibaba Cloud account is created. If you do not have an Alibaba Cloud account,create an Alibaba Cloud account.
- A virtual private cloud (VPC) and a vSwitch are created. For more information, see Create an IPv4 VPC.
- An ECS instance is created in the vSwitch. Applications are deployed on the ECS instance.
For more information, see Create an instance by using the wizard.
In this example, an application that uses Apache is deployed on the ECS instance.
- Make sure that the security group rules of the ECS instance allow the ECS instance
to receive requests from the Internet. In this example, make sure that the inbound
rules of the security group of the ECS instance allow
TCP
access to port80
. For more information, see Add security group rules.
Procedure

Step 1: Create an Internet NAT gateway

Step 2: Associate an EIP with the Internet NAT gateway
An Internet NAT gateway can run as expected only when it is associated with an EIP. After you create an Internet NAT gateway, you can associate EIPs with the Internet NAT gateway to meet your business requirements.

Step 3: Create a DNAT entry
You can create a DNAT entry that uses IP mapping or port mapping to enable an ECS instance to provide Internet-facing services.
Step 4: Test network connectivity
After you create a DNAT entry, you can test the network connectivity by using a computer to access the application that is deployed on the ECS instance.