# Dynamic NAT Port Allocation

Dynamic NAT Port Allocation allows instances in private subnets to initiate outbound connections while efficiently managing port usage. Instead of assigning a fixed port range per instance, this feature dynamically distributes port allocation across the infrastructure.

When enabled, DuploCloud configures GCP to allocate NAT ports dynamically to instances that require outbound internet access. This reduces the number of required external IP addresses and improves scalability in NATed environments.

This feature is especially useful for:

* Highly dynamic workloads.
* Tenants running many lightweight services that occasionally connect to the internet.

## Enabling Dynamic NAT Port Allocation

To enable Dynamic NAT port allocation for a DuploCloud Infrastructure:

1. In the DuploCloud Portal, navigate to **Administrator** → **Infrastructure**.
2. Select the GCP infrastructure you want to configure from the **NAME** column.
3. Select the **Settings** tab.
4. Click **Add**. The **Infra - Set Custom Data** pane displays.<br>

   <div align="left"><figure><img src="/files/YhCQ0f3blovsB8gJJ2Zs" alt=""><figcaption><p><strong>Infra - Set Custom Data</strong> pane</p></figcaption></figure></div>
5. In the **Setting Name** field, select **Enable Dynamic NAT Port Allocation** from the list box.
6. Select **Enable**.
7. Click **Set**. Dynamic NAT Port Allocation is enabled.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.duplocloud.com/docs/automation-platform/overview-1/gcp-services/dynamic-nat-port-allocation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
