All Products
Search
Document Center

NAT Gateway:DescribeNatGateways

Last Updated:Oct 15, 2026

Queries the details of NAT gateways that meet specified conditions in a specified region.

Operation description

This operation queries the details of Internet NAT gateways and VPC NAT gateways. The term NAT gateway in this document refers to both types unless otherwise specified.

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.

You can call the DescribeRegions operation to query region IDs.

cn-hangzhou

NatGatewayId

string

No

The ID of the NAT gateway.

ngw-bp1uewa15k4iy5770****

VpcId

string

No

The ID of the virtual private cloud (VPC) to which the NAT gateway belongs.

vpc-bp15zckdt37pq72z****

Name

string

No

The name of the NAT gateway.

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

test

InstanceChargeType

string

No

  • PrePaid: subscription. This billing method is no longer available for new purchases.

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

PostPaid

Spec

string

No

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

Example value for the China site: Small. Example value for the international site: leave empty

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

rg-bp67acfmxazb4ph****

PageNumber

integer

No

The page number. Default value: 1.

10

PageSize

integer

No

The number of entries per page for paging in a paged query. Maximum value: 50. Default value: 10.

1

DryRun

boolean

No

Specifies whether to only perform a dry run for this request. Valid values:

  • true: performs a dry run on the request without querying the resource status. The system checks whether your AccessKey pair is valid, the authorization of the Resource Access Management (RAM) user, and whether the required parameters are specified. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.

  • false (default): sends a Normal request. If the request passes the dry run, a 2xx HTTP status code is returned and the resource status is queried.

false

Status

string

No

The status of the NAT gateway. Valid values:

  • Creating: Creating a NAT gateway is an asynchronous operation. The NAT gateway remains in the Creating state until the creation is complete.

  • Available: The NAT gateway is created and running. This is a stable state.

  • Modifying: Upgrading or downgrading a NAT gateway is an asynchronous operation. The NAT gateway remains in the Modifying state until the modification is complete.

  • Deleting: Deleting a NAT gateway is an asynchronous operation. The NAT gateway remains in the Deleting state until the deletion is complete.

  • Converting: Upgrading a standard NAT gateway to an enhanced NAT gateway is an asynchronous operation. The NAT gateway remains in the Converting state until the upgrade is complete.

Available

NetworkType

string

No

The type of the NAT gateway. 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. You can specify up to 20 tag keys.

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

KeyTest

Value

string

No

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

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

valueTest

ZoneId

string

No

The zone ID of the NAT gateway.

cn-hangzhou-b

AvailabilityMode

string

No

The disaster recovery type of the NAT gateway. Valid values:

  • CrossAZ: cross-zone disaster recovery.

  • SingleAZ: single-zone disaster recovery.

CrossAZ

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 NAT gateways queried.

1

NatGateways

object

NatGateway

array<object>

The details of the NAT gateways.

array<object>

The details of the NAT gateways.

Status

string

The status of the NAT gateway. Valid values:

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

  • Available: The NAT gateway is created and in a stable state.

  • Modifying: The NAT gateway is being modified. Modifying a NAT gateway is an asynchronous operation, and the status is Modifying during the modification.

  • Deleting: The NAT gateway is being deleted. Deleting a NAT gateway is an asynchronous operation, and the status is Deleting during the deletion.

  • Converting: A standard NAT gateway is being upgraded to an enhanced NAT gateway. This is an asynchronous operation, and the status is Converting during the upgrade.

Creating

CreationTime

string

The time when the NAT gateway was created. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mm:ssZ format.

2021-06-08T12:20:20Z

VpcId

string

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

vpc-bp15zckdt37pq72z****

NatType

string

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

Enhanced

AutoPay

boolean

Specifies whether automatic payment is enabled for orders. Valid values:

  • false: No.

  • true: Yes.

false

Spec

string

The specification of the NAT gateway. This parameter returns an empty value.

When InternetChargeType is set to PayByLcu, an empty value is returned.

Small

DeletionProtection

boolean

Specifies whether deletion protection is enabled. Valid values:

  • true: Yes.

  • false: No.

true

NetworkType

string

The type of the NAT gateway. Valid values:

  • internet: Internet NAT gateway.

  • intranet: VPC NAT gateway.

internet

SecurityProtectionEnabled

boolean

Specifies whether the firewall feature is enabled. Valid values:

  • false: No.

  • true: Yes.

false

InstanceChargeType

string

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

PostPaid

RegionId

string

The region ID of the NAT gateway.

cn-hangzhou

EcsMetricEnabled

boolean

Specifies whether gateway traffic monitoring is enabled. Valid values:

  • true: Yes.

  • false: No.

true

IcmpReplyEnabled

boolean

Specifies whether ICMP echo reply is enabled. Valid values:

  • true: Yes. This is the default value.

  • false: No.

true

Description

string

The description of the NAT gateway.

NAT

ExpiredTime

string

The expiration time of the NAT gateway. The time is displayed in UTC and follows the ISO 8601 standard in the YYYY-MM-DDThh:mmZ format.

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 method of the NAT gateway. Valid values:

  • PayBySpec: billed by defined specifications.

  • PayByLcu: billed by usage.

PayByLcu

BusinessStatus

string

The service status of the NAT gateway. Valid values:

  • Normal: Normal.

  • FinancialLocked: Locked due to overdue payment.

Normal

Name

string

The name of the NAT gateway.

abc

IpLists

object

IpList

array<object>

The list of EIPs associated with the Internet NAT gateway.

object

The list of IP addresses of the NAT gateway.

UsingStatus

string

The association 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 both DNAT and SNAT rules.

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

UsedByForwardTable

IpAddress

string

The IP address of the EIP associated with the NAT gateway.

116.62.XX.XX

SnatEntryEnabled

boolean

Specifies whether an IP address that is already used in a DNAT entry can also be used in an SNAT entry. Valid values:

  • true: Yes.

  • false: No.

false

AllocationId

string

The instance ID of the EIP 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

The ID of the DNAT table of the NAT gateway.

string

The ID of the DNAT table.

ftb-uf6gj3mhsg94qsqst****

SnatTableIds

object

SnatTableId

array

The ID of the SNAT table of the NAT gateway.

string

The ID of the SNAT table.

stb-uf6dalcdu0krz423p****

FullNatTableIds

object

FullNatTableId

array

The ID of the FULLNAT table.

string

The ID of the FULLNAT table.

fulltb-gw88z7hhlv43rmb26****

NatGatewayPrivateInfo

object

The private network information of the enhanced Internet NAT gateway.

Note

If NatType is set to Normal, all parameters in this list return empty values.

VswitchId

string

The ID of the vSwitch to which the NAT gateway belongs.

vsw-bp1s2laxhdf9ayjbo****

EniInstanceId

string

The instance ID of the elastic network interface controller (NIC).

eni-m5eg4ozy5st8q3q4****

MaxBandwidth

integer

The maximum bandwidth. Unit: Mbit/s.

5120

MaxSessionQuota

integer

The maximum number of concurrent connections supported by the NAT gateway.

2000000

MaxSessionEstablishRate

integer

The maximum number of new connections per second supported by the NAT gateway.

100000

PrivateIpAddress

string

The private IP address.

192.168.XX.XX

IzNo

string

The zone to which the NAT gateway belongs.

cn-hangzhou-b

EniType

string

The attachment mode between the elastic network interface controller (NIC) and the NAT gateway. Valid values:

  • indirect: non-direct mode.

  • Empty value: direct mode.

indirect

PrivateLinkEnabled

boolean

Specifies whether PrivateLink is supported. Valid values:

  • true: Yes.

  • false: No.

true

PrivateLinkMode

string

The PrivateLink service translation mode. Valid values:

  • FullNat: FULLNAT mode.

  • Geneve: Geneve mode.

FullNat

EipBindMode

string

The EIP attachment mode of the NAT gateway. Valid values:

  • MULTI_BINDED: multi-EIP network interface controller (NIC) visible mode.

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

Note

When the EIP attachment mode of the NAT gateway is the standard EIP mode, the EIP occupies a private IP of the vSwitch to which the NAT gateway belongs. Ensure that there are sufficient private IP addresses in the vSwitch. If there are no active idle private IP addresses in the vSwitch, you cannot attach new EIPs. When the EIP attachment mode is the standard EIP mode, the maximum number of EIPs that can be attached to the NAT gateway is 50.

MULTI_BINDED

Tags

object

Tag

array<object>

The list of tags.

object

The list of tags.

TagKey

string

The tag key of the instance.

KeyTest

TagValue

string

The tag value of the instance.

valueTest

EnableSessionLog

string

Specifies whether session logging is enabled. Valid values:

  • true: Yes.

  • false: No.

true

AccessMode

object

The access mode for reverse access to the VPC NAT gateway.

ModeValue

string

The access mode. Valid values:

  • route: route mode.

  • tunnel: tunnel mode.

route

TunnelType

string

The tunnel mode type. Valid values:

  • geneve: Geneve.

geneve

AvailabilityMode

string

The disaster recovery type of the NAT gateway. Valid values:

  • CrossAZ: cross-zone disaster recovery.

  • SingleAZ: single-zone disaster recovery.

CrossAZ

IpPrefixList

object

IpPrefixList

array<object>

The list of NAT IP prefix CIDR blocks.

object

IpPrefix

string

The NAT IP prefix CIDR block.

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": "CrossAZ",
        "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.