# NAT Gateway Configuration Guide

## Setup Flow

![Setup flow — from zero to a working NAT Gateway](/files/YUoeb6oRa5VJdlWVAhOA)

Steps **1–3** are required. **4a** and **4b** are independent — add either or both. **5** is verification.

| #  | Task                         | Console path                                                                                                                | What you'll set                                                                                            |
| -- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| 1  | Allocate Elastic IPs         | [Elastic Compute → Elastic IPv4 → Allocate EIP](https://console.zenlayer.com/zec/elastic-ip)                                | Same region as the gateway                                                                                 |
| 2  | Create Public NAT Gateway    | [Public NAT Gateway → Create Public NAT Gateway](https://console.zenlayer.com/zec/nat-gateway/create)                       | Global VPC · subnets to route through the gateway                                                          |
| 3  | Bind an EIPv4 to the gateway | Open [Public NAT Gateway](https://console.zenlayer.com/zec/nat-gateway) → gateway → **Information** → **Bind Elastic IPv4** | Pick one of the allocated EIPs                                                                             |
| 4a | Add a SNAT entry (outbound)  | Same gateway → **NAT Rules** → **Create SNAT Entry**                                                                        | Source subnets / CIDRs · outbound EIPv4                                                                    |
| 4b | Add a DNAT entry (inbound)   | Same gateway → **NAT Rules** → **Create DNAT Entry**                                                                        | EIPv4 + Public port → Private IP + Private port · Protocol (`tcp` / `udp`; `any` only with no port fields) |
| 5  | Verify VPC routes (optional) | [VPC → Route Tables](https://console.zenlayer.com/zec/route-table), filter by type **NAT Gateway**                          | Each covered subnet has a default route to the gateway                                                     |

The gateway must reach `Active` state before step 3. Each new SNAT/DNAT entry is enforced once the gateway applies the rule.

## Day-2 Operations

| Task                        | Console path                                                                                                                                                                                               |
| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Change subnet association   | Gateway detail panel → edit subnet selection                                                                                                                                                               |
| Delete a SNAT or DNAT entry | Gateway → **NAT Rules** → **Delete** on the target entry                                                                                                                                                   |
| Delete the gateway          | [Public NAT Gateway](https://console.zenlayer.com/zec/nat-gateway) → **⋯** (Actions) → **Delete**. Delete unused entries first; remaining EIPs are unbound and gateway routes are withdrawn automatically. |
| View bills and orders       | Gateway → **Information** → **Order and billing** → **View Related Orders** / **View Bill Details**                                                                                                        |


---

# 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.console.zenlayer.com/welcome/elastic-compute/networking/01-overview-3/07-configuration-guide.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.
