After you associate an elastic IP address (EIP) with a NAT Gateway, you can configure a DNAT or SNAT entry by using the EIP. This allows Elastic Compute Service (ECS) instances in your virtual private clouds (VPCs) to provide services over the Internet or access the Internet.
Prerequisites
A NAT Gateway is created and the NAT Gateway meets the following requirements:
You did not purchase a NAT service plan before January 26, 2018 with the Alibaba Cloud account to which the NAT Gateway belongs. If you did, associate the NAT service plan with the NAT Gateway.
The NAT Gateway and the EIP must be created in the same region.
For more information about how to create a NAT Gateway, see Create and manage an Internet NAT gateway.
Procedure
- Log on to the Elastic IP Address console .
- In the top navigation bar, select the region where the EIP is created.
On the Elastic IP Addresses page, find the EIP that you created and click Associate with Resource in the Actions column.
In the Associate EIP with Resource dialog box, set the following parameters and click OK.
Parameter
Description
Instance Type
Select NAT Gateway.
You can select only an Internet NAT Gateway.
Resource Group
Select the resource group to which the Internet NAT Gateway belongs.
Select an instance to associate.
Select an Internet NAT Gateway.
By default, each Internet NAT Gateway can be associated with at most 20 EIPs.
NoteStarting September 19, 2022, if you associate an EIP with a newly created Internet NAT gateway, a private IP address of the vSwitch where the NAT gateway resides is used. Make sure that the vSwitch has sufficient private IP addresses available for use. Otherwise, you cannot associate an EIP with the NAT gateway. Existing NAT gateways are not affected.