AWS NAT

I have a vpc with public and private subnets.  Nat is in public and apache is in private.  How do I get the apache server to register externally using nat public ip on port 80?
Eric DonaldsonAsked:
Who is Participating?
 
Phil PhillipsDirector of DevOps & Quality AssuranceCommented:
Yes, you should be fine with the webserver on the private subnet.

The SG inbound on the NAT instance should allow port 80 to at least everything (you can lock it down more if you need to).

The article in this free course on EE could help: https://www.experts-exchange.com/courses/224/Networking-in-Amazon-Web-Services.html

The console screenshots might be a little out of date, but the concepts are still the same.
0
 
Phil PhillipsDirector of DevOps & Quality AssuranceCommented:
1. Disable source/destination check on the NAT instance (can be done at the EC2 console, via right clicking the instance)
2. In the VPC route table for the private subnet, add a default route (0.0.0.0) that points at the NAT instance.
3. Make sure the security group for the NAT instance allows port 80 in and out.

Though, I would recommend looking at using a nat gateway instead: http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-nat-gateway.html
0
 
Eric DonaldsonAuthor Commented:
thanks;  I will look at the gateway.

I do have the other 3 options configured, although the SG inbound is pointing to the nat instance and outbound is the 0.0.0.0/0.

Also the webserver I have is on the private subnet, will that work
0
 
Eric DonaldsonAuthor Commented:
actually this worked - thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.