---
title: Create
url: https://docs.vultr.com/reference/vultr-cli/vpc/nat-gateway/firewall-rule/create
description: Create a firewall rule for a NAT gateway in a Vultr VPC with the Vultr CLI, setting the protocol, port, and IP range. Includes usage, flags, and an example.
publish_date: 2026-09-30T20:26:01.126199Z
last_updated: 2026-09-30T20:38:33.301170Z
---

> Index of every Vultr Docs page in markdown: https://docs.vultr.com/llms.txt

Creates a new firewall rule for a specified NAT gateway within a VPC, defining traffic filtering criteria such as protocol, port, and IP range.

## Usage

```console
$ vultr-cli vpc nat-gateway firewall-rule create <VPC ID> <NAT Gateway ID> [flags]
```

## Examples

```console
# Full example
$ vultr-cli vpc nat-gateway firewall-rule create e3512e83-64e9-4d3e-a401-9b86f2e09b1d \
efc811e7-d07d-45b1-b50e-19a0c2936ce0 --protocol="tcp" --port="123" --subnet="1.2.3.4" --subnet-size="24" \
--notes="example rule"

--notes is optional. Everything else is required

# Shortened example with aliases
$ vultr-cli vpc ng fr c e3512e83-64e9-4d3e-a401-9b86f2e09b1d efc811e7-d07d-45b1-b50e-19a0c2936ce0 --protocol="tcp" \
-p="123" -s="1.2.3.4" --subnet-size="24" -n="example rule"
```

## Flags
| Shorthand | Long Version | Description |
|-----------|--------------|-------------|
| -n | --notes | notes for the new NAT Gateway firewall rule |
| -p | --port | port or port range for the new NAT Gateway firewall rule |
| - | --protocol | protocol for the new NAT Gateway firewall rule |
| -s | --subnet | subnet for the new NAT Gateway firewall rule |
| - | --subnet-size | subnet size for the new NAT Gateway firewall rule |