All Products
Search
Document Center

NAT Gateway:DescribeNatGateways

Last Updated:Jun 17, 2026

Calls DescribeNatGateways to query the detailed information of NAT gateways that meet specified conditions in a specified region in list form.

Operation description

This operation supports querying detailed information about Internet NAT gateways or VPC NAT gateways. The term "NAT gateway" used in this document does not distinguish between the two types.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:DescribeNatGateways

get

NatGateway

acs:vpc:{#regionId}:{#accountId}:natgateway/*

NatGateway

acs:vpc:{#regionId}:{#accountId}:natgateway/{#NatGatewayId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the NAT gateway to query.

You can call the DescribeRegions operation to obtain the region ID.

cn-hangzhou

NatGatewayId

string

No

The ID of the NAT gateway to query.

ngw-bp1uewa15k4iy5770****

VpcId

string

No

The ID of the VPC to which the NAT gateway to query belongs.

vpc-bp15zckdt37pq72z****

Name

string

No

The name of the NAT gateway to query.

The name must be 1 to 128 characters in length and cannot start with http:// or https://.

test

InstanceChargeType

string

No

  • PrePaid: the legacy subscription billing method. The subscription billing method is no longer available for new purchases.

The billing method of the NAT gateway instance to query. Valid value: PostPaid (pay-as-you-go).

PostPaid

Spec

string

No

The specification of the NAT gateway. Leave this parameter empty.

中国站示例值:Small,国际站示例值:无需填写

NatType

string

No

The type of the NAT gateway. Valid value: Enhanced (enhanced NAT gateway).

Enhanced

ResourceGroupId

string

No

The ID of the resource group to which the NAT gateway to query belongs.

rg-bp67acfmxazb4ph****

PageNumber

integer

No

The page number. Default value: 1.

10

PageSize

integer

No

The number of entries per page for paginated queries. Maximum value: 50. Default value: 10.

1

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run without querying resource status. The check items include whether the AccessKey pair is valid, whether the RAM user is authorized, and whether required parameters are specified. If the check fails, the corresponding error is returned. If the check succeeds, the error code DryRunOperation is returned.

  • false (default): performs a normal request. After the check succeeds, a 2xx HTTP status code is returned and the resource status is queried directly.

false

Status

string

No

The status of the NAT gateway to query. Valid values:

  • Creating: Creating a NAT gateway is an asynchronous operation. The status is Creating before the creation is complete.

  • Available: The status after the NAT gateway is created. This is a stable status.

  • Modifying: Modifying a NAT gateway is an asynchronous operation. The status is Modifying during the modification process.

  • Deleting: Deleting a NAT gateway is an asynchronous operation. The status is Deleting during the deletion process.

  • Converting: Converting a standard NAT gateway to an enhanced NAT gateway is an asynchronous operation. The status is Converting during the conversion process.

Available

NetworkType

string

No

The type of the NAT gateway to query. Valid values:

  • internet: Internet NAT gateway.

  • intranet: VPC NAT gateway.

internet

Tag

array<object>

No

The list of tags.

object

No

The list of tags.

Key

string

No

The tag key of the NAT gateway instance. You can specify up to 20 tag keys.

The tag key can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

KeyTest

Value

string

No

The tag value of the NAT gateway instance. You can specify up to 20 tag values.

The tag value can be up to 128 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

valueTest

ZoneId

string

No

The ID of the zone where the NAT gateway is deployed.

cn-hangzhou-b

AvailabilityMode

string

No

Response elements

Element

Type

Description

Example

object

The number of entries per page.

PageSize

integer

The number of entries per page.

10

RequestId

string

The request ID.

4EC47282-1B74-4534-BD0E-403F3EE64CAF

PageNumber

integer

The current page number.

10

TotalCount

integer

The total number of entries in the NAT gateway list.

1

NatGateways

object

NatGateway

array<object>

The detailed information of the NAT gateway.

array<object>

The detailed information of the NAT gateway.

Status

string

The status of the NAT Gateway. Valid values:

  • Creating: The NAT Gateway is being created. The process is asynchronous.

  • Available: The NAT Gateway is stable and ready for use.

  • Modifying: The NAT Gateway is being modified. The process is asynchronous.

  • Deleting: The NAT Gateway is being deleted. The process is asynchronous.

  • Converting: The NAT Gateway is being converted from a standard to an Enhanced type. The process is asynchronous.

Creating

CreationTime

string

The time when the NAT Gateway was created.

2021-06-08T12:20:20Z

VpcId

string

The ID of the VPC where the NAT Gateway is deployed.

vpc-bp15zckdt37pq72z****

NatType

string

The type of NAT Gateway. A value of Enhanced indicates an Enhanced NAT Gateway.

Enhanced

AutoPay

boolean

Indicates whether the order is automatically paid. Valid values:

  • false: The order is not automatically paid.

  • true: The order is automatically paid.

false

Spec

string

The specification of the NAT Gateway. This parameter is empty.

This parameter is empty if the InternetChargeType is PayByLcu.

Small

DeletionProtection

boolean

Indicates whether deletion protection is enabled. Valid values:

  • true: Enabled.

  • false: Disabled.

true

NetworkType

string

The type of the NAT Gateway. Valid values:

  • internet: an Internet NAT Gateway.

  • intranet: a VPC NAT Gateway.

internet

SecurityProtectionEnabled

boolean

Indicates whether the firewall feature is enabled. Valid values:

  • false: The firewall feature is disabled.

  • true: The firewall feature is enabled.

false

InstanceChargeType

string

The billing method of the NAT Gateway instance. The value is PostPaid (Pay-As-You-Go).

PostPaid

RegionId

string

The ID of the region where the NAT Gateway is deployed.

cn-hangzhou

EcsMetricEnabled

boolean

Indicates whether the traffic monitoring feature is enabled. Valid values:

  • true: Enabled.

  • false: Disabled.

true

IcmpReplyEnabled

boolean

Indicates whether the ICMP reply feature is enabled. Valid values:

  • true (default): Enabled.

  • false: Disabled.

true

Description

string

The description of the NAT Gateway.

NAT

ExpiredTime

string

The time when the NAT Gateway expires.

2021-08-26T16:00Z

ResourceGroupId

string

The ID of the resource group.

rg-bp67acfmxazb4ph****

NatGatewayId

string

The ID of the NAT Gateway.

ngw-bp1047e2d4z7kf2ki****

InternetChargeType

string

The billing type of the NAT Gateway. Valid values:

  • PayBySpec: pay-by-specification.

  • PayByLcu: pay-by-CU.

PayByLcu

BusinessStatus

string

The business status of the NAT Gateway. Valid values:

  • Normal: The NAT Gateway is working as expected.

  • FinancialLocked: The NAT Gateway is locked due to an overdue payment.

Normal

Name

string

The name of the NAT Gateway instance.

abc

IpLists

object

IpList

array<object>

A list of EIPs associated with the Internet NAT Gateway.

object

Details of an EIP associated with the NAT gateway.

UsingStatus

string

The status of the EIP associated with the Internet NAT Gateway. Valid values:

  • UsedByForwardTable: The EIP is used in a DNAT rule.

  • UsedBySnatTable: The EIP is used in an SNAT rule.

  • UsedByForwardSnatTable: The EIP is used in DNAT and SNAT rules.

  • Idle: The EIP is not used in any DNAT or SNAT rules.

UsedByForwardTable

IpAddress

string

The IP address of the EIP that is associated with the NAT Gateway.

116.62.XX.XX

SnatEntryEnabled

boolean

Indicates whether an IP address that is used in a DNAT rule can also be used in an SNAT rule. Valid values:

  • true: The IP address can also be used in an SNAT entry.

  • false: The IP address cannot be used in an SNAT entry.

false

AllocationId

string

The ID of the EIP that is associated with the NAT Gateway.

eip-m5egzuvp3dgixen6****

PrivateIpAddress

string

The private IP address of the NAT Gateway.

192.168.XX.XX

ForwardTableIds

object

ForwardTableId

array

A list of DNAT table IDs.

string

The ID of the DNAT table.

ftb-uf6gj3mhsg94qsqst****

SnatTableIds

object

SnatTableId

array

A list of SNAT table IDs.

string

The ID of the SNAT table.

stb-uf6dalcdu0krz423p****

FullNatTableIds

object

FullNatTableId

array

A list of FULLNAT table IDs.

string

The ID of the FULLNAT table.

fulltb-gw88z7hhlv43rmb26****

NatGatewayPrivateInfo

object

The private network details of the enhanced Internet NAT Gateway.

Note

If NatType is set to Normal, the parameters in this object are empty.

VswitchId

string

The ID of the VSwitch to which the NAT Gateway belongs.

vsw-bp1s2laxhdf9ayjbo****

EniInstanceId

string

The ID of the elastic network interface (ENI).

eni-m5eg4ozy5st8q3q4****

MaxBandwidth

integer

The maximum bandwidth. Unit: Mbps.

5120

MaxSessionQuota

integer

The maximum number of concurrent connections.

2000000

MaxSessionEstablishRate

integer

The maximum new connection rate, in connections per second.

100000

PrivateIpAddress

string

The private IP address.

192.168.XX.XX

IzNo

string

The zone where the NAT Gateway is deployed.

cn-hangzhou-b

EniType

string

The mode in which the ENI is associated with the NAT Gateway. Valid values:

  • indirect: non-direct connection mode.

  • If an empty value is returned, it indicates the direct connection mode.

indirect

PrivateLinkEnabled

boolean

Indicates whether PrivateLink is enabled. Valid values:

  • true: PrivateLink is enabled.

  • false: PrivateLink is disabled.

true

PrivateLinkMode

string

The mode of the PrivateLink service. Valid values:

  • FullNat: FULLNAT mode.

  • Geneve: Geneve mode.

FullNat

EipBindMode

string

The mode in which EIPs are associated with the NAT Gateway. Valid values:

  • MULTI_BINDED: multi-EIP NIC-visible mode.

  • NAT: standard EIP mode, compatible with IPv4 gateways.

Note

If the NAT Gateway uses standard EIP mode, each EIP consumes a private IP address from the VSwitch where the NAT Gateway is deployed. Make sure that the VSwitch has a sufficient number of private IP addresses. Otherwise, you cannot associate new EIPs with the NAT Gateway. In standard EIP mode, you can associate a maximum of 50 EIPs with a NAT Gateway.

MULTI_BINDED

Tags

object

Tag

array<object>

The list of tags.

object

A tag object, which consists of a key-value pair.

TagKey

string

The tag key of the instance.

KeyTest

TagValue

string

The tag value of the instance.

valueTest

EnableSessionLog

string

Indicates whether the session log feature is enabled. Valid values:

  • true: Enabled.

  • false: Disabled.

true

AccessMode

object

The reverse access mode of the VPC NAT Gateway.

ModeValue

string

The access mode. Valid values:

  • route: route mode.

  • tunnel: tunnel mode.

route

TunnelType

string

The type of the tunnel mode:

  • geneve: Geneve.

geneve

AvailabilityMode

string

IpPrefixList

object

IpPrefixList

array<object>

A list of NAT IP prefixes.

object

IpPrefix

string

The NAT IP prefix.

192.168.0.0/28

Examples

Success response

JSON format

{
  "PageSize": 10,
  "RequestId": "4EC47282-1B74-4534-BD0E-403F3EE64CAF",
  "PageNumber": 10,
  "TotalCount": 1,
  "NatGateways": {
    "NatGateway": [
      {
        "Status": "Creating",
        "CreationTime": "2021-06-08T12:20:20Z",
        "VpcId": "vpc-bp15zckdt37pq72z****",
        "NatType": "Enhanced",
        "AutoPay": false,
        "Spec": "Small",
        "DeletionProtection": true,
        "NetworkType": "internet",
        "SecurityProtectionEnabled": false,
        "InstanceChargeType": "PostPaid",
        "RegionId": "cn-hangzhou",
        "EcsMetricEnabled": true,
        "IcmpReplyEnabled": true,
        "Description": "NAT",
        "ExpiredTime": "2021-08-26T16:00Z",
        "ResourceGroupId": "rg-bp67acfmxazb4ph****",
        "NatGatewayId": "ngw-bp1047e2d4z7kf2ki****",
        "InternetChargeType": "PayByLcu",
        "BusinessStatus": "Normal",
        "Name": "abc",
        "IpLists": {
          "IpList": [
            {
              "UsingStatus": "UsedByForwardTable",
              "IpAddress": "116.62.XX.XX",
              "SnatEntryEnabled": false,
              "AllocationId": "eip-m5egzuvp3dgixen6****",
              "PrivateIpAddress": "192.168.XX.XX"
            }
          ]
        },
        "ForwardTableIds": {
          "ForwardTableId": [
            "ftb-uf6gj3mhsg94qsqst****"
          ]
        },
        "SnatTableIds": {
          "SnatTableId": [
            "stb-uf6dalcdu0krz423p****"
          ]
        },
        "FullNatTableIds": {
          "FullNatTableId": [
            "fulltb-gw88z7hhlv43rmb26****"
          ]
        },
        "NatGatewayPrivateInfo": {
          "VswitchId": "vsw-bp1s2laxhdf9ayjbo****",
          "EniInstanceId": "eni-m5eg4ozy5st8q3q4****",
          "MaxBandwidth": 5120,
          "MaxSessionQuota": 2000000,
          "MaxSessionEstablishRate": 100000,
          "PrivateIpAddress": "192.168.XX.XX",
          "IzNo": "cn-hangzhou-b",
          "EniType": "indirect"
        },
        "PrivateLinkEnabled": true,
        "PrivateLinkMode": "FullNat",
        "EipBindMode": "MULTI_BINDED",
        "Tags": {
          "Tag": [
            {
              "TagKey": "KeyTest",
              "TagValue": "valueTest"
            }
          ]
        },
        "EnableSessionLog": "true",
        "AccessMode": {
          "ModeValue": "route",
          "TunnelType": "geneve"
        },
        "AvailabilityMode": "",
        "IpPrefixList": {
          "IpPrefixList": [
            {
              "IpPrefix": "192.168.0.0/28"
            }
          ]
        }
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

500 InternalError The request processing has failed due to some unknown error, exception or failure. An internal error occurred.
404 InvalidRegionId.NotFound The specified RegionId does not exist in our records.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.