Interview Prep/Networking/VPC & Cloud Network Design

Explain internet gateway versus NAT gateway and when you use each.

BeginnerScenarioVPC & Cloud Network Design
Answer

Situation read → They solve opposite directions of internet access.

What I'd do →

  1. Use an IGW for resources with public IPs that must be reachable from and reach the internet (ALB, bastions)
  2. Use a NAT gateway so private instances can start outbound connections (package updates, API calls) without being reachable inbound
  3. Place the NAT gateway in a public subnet with an Elastic IP
  4. Point private route tables 0.0.0.0/0 at the NAT gateway

Why → NAT gateways translate the private source to the NAT's Elastic IP and only allow return traffic for connections initiated from inside.

Interview tip → Mention NAT gateway cost (hourly plus per GB) because it is a favourite follow-up.

All Networking questions Roadmap: Networking for DevOps

More on VPC & Cloud Network Design