All Products
Search
Document Center

Elastic IP Address:Associate an EIP with a NAT gateway

Last Updated:Dec 29, 2023

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

  1. Log on to the Elastic IP Address console .
  2. In the top navigation bar, select the region where the EIP is created.
  3. On the Elastic IP Addresses page, find the EIP that you created and click Associate with Resource in the Actions column.

  4. 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.

    Note

    Starting 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.