Quotas and limits

This document lists the quotas and limits that apply to Cloud NAT.

A given quota or limit is calculated per resource. Quotas and limits may be per project, per network, per region, or per another resource. NAT IP addresses cannot be shared between NAT gateways. To change a quota, see requesting additional quota.

A quota restricts how much of a particular shared Google Cloud resource your Cloud project can use, including hardware, software, and network components.

Quotas are part of a system that does the following:

  • Monitors your use or consumption of Google Cloud products and services.
  • Restricts your consumption of those resources for reasons including ensuring fairness and reducing spikes in usage.
  • Maintains configurations that automatically enforce prescribed restrictions.
  • Provides a means to make or request changes to the quota.

When a quota is exceeded, in most cases, the system immediately blocks access to the relevant Google resource, and the task that you're trying to perform fails. In most cases, quotas apply to each Cloud project and are shared across all applications and IP addresses that use that Cloud project.

Many products and services also have limits that are unrelated to the quota system. These are constraints, such as maximum file sizes or database schema limitations, which generally cannot be increased or decreased, unless otherwise stated.

Quotas

For quotas that affect Cloud NAT, see the Cloud Router quotas page.

Limits

Item Limit Notes
NAT gateways 50 per Cloud Router Each network supports up to 5 Cloud Router instances per region, so you can have up to 250 Cloud NAT gateways per region per VPC network. For Cloud Router quotas, see the Cloud Router documentation.
NAT IP addresses per gateway

50 manual addresses

300 auto-allocated addresses

The maximum number of external IP addresses that you can have on a NAT gateway. Regional restrictions also apply.
NAT IP addresses per region

300 auto-allocated addresses


12,500 manually allocated addresses

The total number of manually allocated addresses is the product of (routers per region) * (NAT gateways per router) * (IP addresses per NAT gateway).
Subnet ranges 50 per gateway The maximum number of primary and secondary subnet IP address ranges that you can associate with a gateway.
NAT rules 50 per gateway If this limit is exceeded, the API returns an error.
Active IP addresses per NAT rule 50
Characters in CEL expressions per rule 2,048
Characters in CEL expressions per Cloud Router instance 500,000

Limitations

  • Some servers such as legacy DNS servers require UDP port randomization among 64,000 ports for enhanced security. Because Cloud NAT selects a random port from one of 64 or a user-configured number of ports, it is best to assign an external IP address to these servers instead of using Cloud NAT. Because Cloud NAT does not allow connections initiated from outside, most of these servers are required to use an external IP address anyway.

  • Cloud NAT is not available for legacy networks.

  • NAT ALGs (Application Level Gateway) functionality is not supported. This means that Cloud NAT does update IP in the packet data (such as for FTP, SIP, and other such protocols).

  • VMs with an external IP address can have 64,000 TCP, 64,000 UDP, and 64,000 ICMP-query sessions (ping) simultaneously if they have enough compute/memory resources. For Cloud NAT, this limit is reduced to a total of 64,000 connections per VM for all supported protocols combined.

  • Small idle connection timeouts may not work.

    NAT mappings are checked every 30 seconds for expiration and configuration change. Even if a connection timeout value of 5 seconds is used, the connection may not be available for up to 30 seconds in the worst case, and 15 seconds in the average case.

Managing quotas

Cloud NAT enforces quotas on resource usage for various reasons. For example, quotas protect the community of Google Cloud users by preventing unforeseen spikes in usage. Quotas also help users who are exploring Google Cloud with the free tier to stay within their trial.

All projects start with the same quotas, which you can change by requesting additional quota. Some quotas may increase automatically based on your use of a product.

Permissions

To view quotas or request quota increases, Identity and Access Management (IAM) principals need one of the following roles.

Task Required role
Check quotas for a project One of the following:
Modify quotas, request additional quota One of the following:

Checking your quota

Console

  1. In the Cloud Console, go to the Quotas page.

    Go to Quotas

  2. To search for the quota that you want to update, use the Filter table. If you don't know the name of the quota, use the links on this page instead.

gcloud

Using the gcloud command-line tool, run the following command to check your quotas. Replace PROJECT_ID with your own project ID.

      gcloud compute project-info describe --project PROJECT_ID
    

To check your used quota in a region, run the following command:

      gcloud compute regions describe example-region
    

Errors when exceeding your quota

If you exceed a quota with a gcloud command, gcloud outputs a quota exceeded error message and returns with the exit code 1.

If you exceed a quota with an API request, Google Cloud returns the following HTTP status code: HTTP 413 Request Entity Too Large.

Requesting additional quota

To increase or decrease most quotas, use the Google Cloud Console. Some quotas can't be increased above their default values.

For more information, see the following sections of Working with quotas:

Console

  1. In the Cloud Console, go to the Quotas page.

    Go to Quotas

  2. On the Quotas page, select the quotas that you want to change.
  3. At the top of the page, click Edit quotas.
  4. Fill out your name, email, and phone number, and then click Next.
  5. Fill in your quota request, and then click Done.
  6. Submit your request. Quota requests take 24 to 48 hours to process.

Resource availability

Each quota represents a maximum number for a particular type of resource that you can create, if that resource is available. It's important to note that quotas do not guarantee resource availability. Even if you have available quota, you can't create a new resource if it is not available.

For example, you might have sufficient quota to create a new regional, external IP address in the us-central1 region. However, that is not possible if there are no available external IP addresses in that region. Zonal resource availability can also affect your ability to create a new resource.

Situations where resources are unavailable in an entire region are rare. However, resources within a zone can be depleted from time to time, typically without impact to the service level agreement (SLA) for the type of resource. For more information, review the relevant SLA for the resource.