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 10 months ago277 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

profile pictureAWS
Matt_E
answered 10 months ago
profile pictureAWS
EXPERT
iBehr
reviewed 10 months 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

profile pictureAWS
EXPERT
kentrad
answered 10 months ago
profile picture
EXPERT
reviewed 10 months ago
profile picture
EXPERT
reviewed 10 months 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.

Guidelines for Answering Questions