Skip to content

Nat gateway and internet gateway

0

The vpc currently routes 0.0.0.0/0 to an internet gateway. There are no options for public and private routes. Can I add 0.0.0.0/0 route to a nat gateway as well? Will this stop the internet gateway working?

asked 2 years ago407 views

2 Answers
4

Since the end of 2025, you have an additional option with the Amazon VPC Regional NAT Gateway, described and introduced in the following link by AWS. This means you no longer need to carefully ensure that the route with 0.0.0.0/0 in a private subnet is routed to the relevant NAT-Gateway within the same Availability Zone. This avoids cross-Availability Zone traffic and prevents misconfiguration and potential issues:

EXPERT

answered 7 months ago

2
Accepted Answer

A Nat Gateway needs an internet gateway to route to the internet. You need different route tables for the private and public subnets

Please see example of how NAT Gateways and Internet Gateways should be setup

Enter image description here

Public Route Table

DestinationTarget
0.0.0.0/0igw-id

Private Route Table

DestinationTarget
0.0.0.0/0nat-gateway-id

https://docs.aws.amazon.com/vpc/latest/userguide/vpc-example-private-subnets-nat.html

EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.