Skip to main content

Create a nat gateway

Reviewed on · View on GitHub

You can create a nat gateway in a subnet of a VPC (Virtual Private Cloud) to allow the VM (Virtual Machine) in that subnet to connect to the Internet indirectly. You can create a nat gateway for each public subnet of the VPC.

Permissions​

info

This action requires the following IAM (Identity and Access Management) permissions:

  • compute.natGateway.create

Prerequisites​

info

To do this, you must also:

  • add a rule allowing outbound flows to the Internet to the security groups used for the VM you want to connect to the Internet;
  • add a route with the CIDR (Classless Inter Domain Routing) block 0.0.0.0/0 (or a smaller IP range) as the destination and the ID of the newly created nat gateway as the target to the route table of this subnet containing your VM.

Console​

From the left-hand side menu, click Network → VPC → NAT Gateways.
  1. From the left-hand side menu, click Network → VPC → NAT Gateways.

  2. From the list of nat gateways, click Create a NAT Gateway.

A "NAT Gateway creation" page appears.

  1. In the "Name" field, enter a name for the nat gateway.
info

This action adds a Name tag of up to 255 characters. You can use all characters, including accented letters.

  1. In the "VPC" list, select the VPC in which you want to create a nat gateway.
  2. In the "Subnet" list, select the subnet in which you want to create a nat gateway.
info

Only subnets with a route pointing to an internet gateway on the IP range 0.0.0.0/0 are displayed.

  1. In the "Public IP" list, select the public IP you want to associate with the nat gateway.
  2. Click Create the NAT Gateway.

A confirmation message appears at the bottom of the page indicating that the nat gateway has been created.