Create a NAT Gateway

Beta Creates a NAT Gateway to let Linodes in a VPC connect to the public internet and receive responses, without allowing incoming connections from external hosts. NAT Gateway uses shared ports and allows multiple Linodes to share a single public IPv4 address (a one-to-many NAT setup).

Only region and label are required to create a NAT Gateway. Defaults are available and recommended for other fields.

Permissions and scopes

To call this operation, you need the following:

  • OAuth scopes. Your user needs these scopes assigned. Learn more.

    • Scopes: natgateways:read_write

CLI

linode-cli natgateways create \
  --region us-east \
  --label nat-gateway-vpc1

Learn more

Path Params
string
enum
required

Enum Call either the v4 URL, or v4beta for operations still in Beta.

Allowed:
Body Params

An object describing a NAT Gateway belonging to the account.

addresses
array of objects

A list of allocated or assigned public IPv4 addresses associated with this NAT Gateway.

addresses
integer
enum

Filterable Number of ports allocated per interface behind the NAT Gateway. Outbound traffic is tracked using isolated blocks of sequential ports called portsets. Assigning a larger portset allows a single Linode interface to open more concurrent connections, but decreases the total number of Linodes a single public IP address can support simultaneously.

The standard minimum size is 4096. Values below 4096 require a specific account capability tag.

string
required
length between 1 and 64

Filterable The NAT Gateway's label, for display purposes only.

  • Needs to be unique among the account's NAT Gateways.
  • Can only contain ASCII letters, numbers, and dashes (-). You can't use two consecutive dashes (--).
string
required

Filterable The region where the NAT Gateway is located. Must match the region of the VPC it connects to.

boolean

Write-only Indicates whether this NAT Gateway automatically adjusts its public IPv4 allocations based on traffic demands.

  • true. The NAT Gateway automatically scales up to a maximum number of IPs (visible via address_autoscale_max). The addresses array must be left empty ([]) in the request.
  • false. Public IPv4 addresses must be manually assigned and managed using the addresses array.
  • If omitted and the addresses array is populated, this defaults to false. If omitted and addresses is empty, this defaults to true.
integer

Write-only The unique ID of the VPC subnet to attach to this NAT Gateway upon creation. The targeted subnet must not contain Linodes using legacy interfaces.

Responses

Language
Credentials
LoadingLoading…
Response
Choose an example:
application/json