Skip to content

NAT gateway not working

0

I am trying to set up a subnet and route that has a single outgoing IP. I set up a route to a NAT gateway but it does not appear to work. If I swap the NAT for an IGW then the instances on that subnet have internet access. If I change it to a NAT they do not.

asked 3 years ago949 views

2 Answers
0

Are the instances in a private or public subnets? Do they have a public IP address or only a private IP address? If the instances are in a private subnet, then you route the traffic of that subnet to the NATGW and then to the IGW. https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Internet_Gateway.html

AWS

answered 3 years ago

AWS
EXPERT

reviewed 3 years ago

0

The instances need to be in a private subnet where the route table attached to the private subnet has a route for your destination IP and a target of the NAT Gateway. The NAT Gateway needs to be in a public subnet where the route table attached to the public subnet has a route of all non-local destinations (0.0.0.0/0) has a target of the internet gateway.

ref: NAT gateway use cases

AWS
EXPERT

answered 3 years ago

EXPERT

reviewed 3 years ago

EXPERT

reviewed 3 years ago

  • To add, any instances that need direct internet access NOT via a NAT Gateway need to be in a Public Subnet with a Public IP Address with a route to an IGW

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.