---
title: "ezgh compute nat-gateways create"
description: "Create a NAT gateway."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh compute nat-gateways create

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh compute nat-gateways create <name> --vpc <vpc> --subnet <subnet> [--wait] [flags]
```

Create a NAT gateway in a subnet of a VPC. The subnet must be public: the VPC has an attached Network Gateway (network_gateway_required otherwise) and the subnet's route table routes 0.0.0.0/0 to it (subnet_not_public otherwise). Keep 4 addresses free in the subnet.

The gateway's public IPv4 address is assigned at once, before the gateway is active. Creating a gateway changes no routes: send a private subnet's traffic through it with `ezgh compute route-tables routes set <table> 0.0.0.0/0 --target <nat_…>`. `--wait` waits until it's active and prints it.

Part of [`ezgh compute nat-gateways`](/cli/reference/compute-nat-gateways).

## Examples

```sh
ezgh compute nat-gateways create egress --vpc main --subnet public --wait
ezgh compute route-tables routes set private 0.0.0.0/0 --target nat_…
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--subnet` | string |  | the public subnet the gateway goes in (ID, UUID or name; required) |
| `--vpc` | string |  | the VPC (ID, UUID or name; required) |
| `--wait` | boolean |  | wait until it's active, and print it then |
| `--wait-timeout` | duration | `10m0s` | how long `--wait` waits |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/compute-nat-gateways-create/index.mdx
