Quotas and limits
This document lists the quotas and system limits that apply to Cloud NAT.
- Quotas specify the amount of a countable, shared resource that you can use. Quotas are defined by Google Cloud services such as Cloud NAT.
- System limits are fixed values that cannot be changed.
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 can't be shared between NAT gateways. To change a quota, see requesting additional quota.
Google Cloud uses quotas to help ensure fairness and reduce spikes in resource use and availability. A quota restricts how much of a Google Cloud resource your Google Cloud project can use. Quotas apply to a range of resource types, including hardware, software, and network components. For example, quotas can restrict the number of API calls to a service, the number of load balancers used concurrently by your project, or the number of projects that you can create. Quotas protect the community of Google Cloud users by preventing the overloading of services. Quotas also help you to manage your own Google Cloud resources.
The Cloud Quotas system does the following:
- Monitors your consumption of Google Cloud products and services
- Restricts your consumption of those resources
- Provides a way to request changes to the quota value
In most cases, when you attempt to consume more of a resource than its quota allows, the system blocks access to the resource, and the task that you're trying to perform fails.
Quotas generally apply at the Google Cloud project level. Your use of a resource in one project doesn't affect your available quota in another project. Within a Google Cloud project, quotas are shared across all applications and IP addresses.
There are also system limits on Cloud NAT resources. System limits can't be changed.
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 Virtual Private Cloud (VPC) network. For Cloud Router quotas, see the Cloud Router documentation. |
NAT IP addresses per gateway | 300 manual addresses 300 auto-allocated addresses |
The maximum number of external IP addresses that you can have on a NAT gateway. However, this value depends on the static IP addresses and in-use IP addresses VPC per-project quotas. |
Subnet ranges | 50 per gateway | The maximum number of subnets that you can associate with a gateway when you configure a custom list of subnet ranges. The number of subnet ranges might be more than the limit because each subnet can have a primary IPv4 range and one or more secondary ranges. If you have configured NAT for primary ranges for all subnets or primary and secondary ranges for all subnets, this limit doesn't apply. |
NAT rules | 50 per gateway | If this limit is exceeded, the API returns an error. |
Active IP addresses per NAT rule | 300 | |
Private NAT subnets | 50 per gateway | The maximum number of subnets that you can reserve for use as the source
NAT ranges for Private NAT. These subnets have a purpose of PRIVATE_NAT . |
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 doesn't allow connections initiated from outside, most of these servers are required to use an external IP address anyway.
Cloud NAT isn't available for legacy networks.
Cloud NAT doesn't provide application-level gateway (ALG) capabilities—Cloud NAT doesn't update the IP address and port information in the packet data for application layer protocols such as FTP and SIP.
Cloud NAT gateways implement NAT connection tracking tables for each VM network interface on which it provides NAT services. Entries in each connection tracking table are 5-tuple hashes for the gateway's supported protocols.
Entries in each connection tracking table persist for about as long as the relevant NAT timeout. For more information about NAT timeouts, see NAT timeouts.
The maximum number of connection tracking table entries for all NAT connections associated with a VM is 65,535. This maximum covers connections, in aggregate, for all protocols that the gateway supports, across all network interfaces of the VM.
Small idle connection timeouts might 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.
Manage 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 might 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:
|
Check your quota
Console
- In the Google Cloud console, go to the Quotas page.
- 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 Google Cloud CLI, 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: 413 Request Entity Too Large
.
Request additional quota
To adjust most quotas, use the Google Cloud console. For more information, see Request a quota adjustment.
Console
- In the Google Cloud console, go to the Quotas page.
- On the Quotas page, select the quotas that you want to change.
- At the top of the page, click Edit quotas.
- For Name, enter your name.
- Optional: For Phone, enter a phone number.
- 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 don't 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 a given 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.