Skip to content
RED SAGSkills
mediumCloud Engineer interview question

An instance in a private subnet cannot reach the internet to install packages. How do you troubleshoot it?

What the interviewer wants to hear

  • Check the private subnet route table has 0.0.0.0/0 to a NAT gateway
  • Check the NAT gateway is in a public subnet with a route to an internet gateway and is available
  • Check security group outbound rules and NACL rules including ephemeral ports
  • Check DNS resolution settings in the VPC
  • Use tools like Reachability Analyzer and VPC Flow Logs

Model answer

I would follow the packet path step by step. First, the private subnet route table must send 0.0.0.0/0 to a NAT gateway. Second, that NAT gateway must sit in a public subnet whose route table points 0.0.0.0/0 to an internet gateway attached to the VPC, and the NAT must be in the available state with an Elastic IP. Third, I check the instance security group allows outbound traffic on 80 and 443, and that the network ACLs on both subnets allow outbound traffic and the inbound return traffic on ephemeral ports 1024 to 65535, since NACLs are stateless. Fourth, I check DNS: the VPC needs DNS resolution enabled, and I test with nslookup or curl to an IP. Finally, VPC Reachability Analyzer and Flow Logs quickly show where traffic is rejected. If the instance only needs AWS services, VPC endpoints may be a better answer.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium Cloud Engineer questions