Interview Prep/Networking/Cloud networking: VPC, firewalls, NAT, VPN and proxies

The SG allows inbound 443 and the app works from inside the VPC, but internet clients time out. The subnet NACL allows inbound 443.

IntermediateTroubleshootingCloud networking: VPC, firewalls, NAT, VPN and proxies
Answer

Likely causes → NACLs are stateless. Responses go back to the client's ephemeral port (1024–65535), and the NACL's outbound rules don't allow that, so replies are dropped. Security groups are stateful and don't have this problem.

Diagnose →

aws ec2 describe-network-acls --filters Name=association.subnet-id,Values=<subnet-id> \
  --query 'NetworkAcls[0].Entries'
# Flow Logs: ACCEPT on the inbound record, REJECT on the outbound response

Fix → Add an outbound NACL rule allowing TCP 1024–65535 to 0.0.0.0/0 (and the matching inbound rule for responses to the instance's own outbound calls).

Prevent → Keep NACLs simple (default allow) and use SGs for fine-grained control unless compliance demands NACLs.

All Networking questions Roadmap: Networking for DevOps

More on Cloud networking: VPC, firewalls, NAT, VPN and proxies