Interview Prep/Networking/VPC & Cloud Network Design

What makes a subnet public versus private in AWS?

BeginnerScenarioVPC & Cloud Network Design
Answer

Situation read → Subnets have no public/private flag; the difference is entirely the route table and the IP assignment.

What I'd do →

  1. Look at the subnet route table: a route 0.0.0.0/0 -> igw-xxxx makes it public
  2. Check that instances have a public or Elastic IP, otherwise the IGW route is useless for them
  3. Private subnets send 0.0.0.0/0 to a NAT gateway or have no default route at all
  4. Verify with aws ec2 describe-route-tables --filters Name=association.subnet-id,Values=subnet-0abc

Why → The internet gateway only does 1:1 NAT for instances that already have a public IPv4 address.

Interview tip → Say that load balancers and NAT gateways go in public subnets, while application and database tiers stay private.

All Networking questions Roadmap: Networking for DevOps

More on VPC & Cloud Network Design