How does a private subnet know how to route to a NAT gateway in the public subnet

0

Hello. So I have been reading documentation and I am confused on the NAT gateway setup. I get that the NAT gateway is needed in order for private subnets to access the Internet and that the NAT gateway needs to be in the public subnet.
What I am not understanding is how does the private subnet communicate with the NAT gateway? I am not seeing the connection because the private subnet cannot see the public subnet. Is there a route for this in the route tables that I am not seeing?

질문됨 10달 전559회 조회
1개 답변
1
수락된 답변

In the private subnet(s) you need a route to the NAT Gateway. To do this, create a new VPC route table; create a default route (0.0.0.0/0) in that route table that has a destination of the NAT Gateway; then assign the route table to the private subnet(s). In the VPC you'll have two route tables: One for the public subnet(s) which has a default route to the Internet Gateway; and one for the private subnet(s).

profile pictureAWS
전문가
답변함 10달 전
profile picture
전문가
검토됨 10달 전
  • Got it, thank you. It was that default route with target to the NAT that I missed.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠