Troubleshoot Internal Instance Connectivity — Security Groups and Network ACLs
A company has a VPC with a public subnet and a private subnet. The public subnet contains a web server (EC2 instance) that must be accessible from the internet. The private subnet contains a database server (EC2 instance) that should only be accessible from the web server. The web server's security group allows HTTP (80) and HTTPS (443) from 0.0.0.0/0. The database server's security group allows MySQL (3306) from the web server's security group. However, the web server cannot connect to the database server. The network engineer has verified that the web server can reach the internet and that the database server's security group is correctly configured. What is the most likely cause of the connectivity problem?
Quick Answer
The answer is the custom network ACL associated with the private subnet blocking inbound MySQL traffic from the web server. Security groups are stateful and operate at the instance level, automatically allowing return traffic, but network ACLs are stateless and operate at the subnet level, requiring explicit inbound and outbound rules for both directions. Even if the database server’s security group correctly permits MySQL from the web server’s security group, a restrictive inbound rule in the private subnet’s NACL will drop the traffic before it reaches the instance. On the AWS Certified Advanced Networking Specialty ANS-C01 exam, this scenario tests your ability to distinguish between security group and network ACL behavior, a common trap where engineers focus only on instance-level rules while forgetting subnet-level stateless filtering. A key memory tip: security groups are a “smart door” that remembers who knocked, while NACLs are a “bouncer” that checks every single packet both ways—always verify both directions for stateless ACLs.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The network ACL associated with the private subnet is blocking inbound MySQL traffic from the web server.
Security groups are stateful, meaning that if the web server initiates traffic to the database, the return traffic is automatically allowed regardless of outbound rules in the security group. However, network ACLs (NACLs) are stateless and require explicit inbound and outbound rules. In this scenario, the database server's security group is correctly configured to allow MySQL traffic from the web server's security group, indicating that the security group is not the issue. The most likely cause is that the network ACL associated with the private subnet is blocking inbound MySQL traffic (port 3306) from the web server. Option A is incorrect because the route table for the private subnet does not need a route to the public subnet for traffic within the same VPC; local routes handle that. Option B is incorrect because security groups are stateful, so outbound traffic from the web server to the database is allowed by default. Option D is incorrect because the database server does not need a route to the internet gateway for internal VPC communication.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The route table for the private subnet does not have a route to the public subnet.
Why it's wrong here
Incorrect: Route tables are not needed for traffic within the same VPC; subnets can communicate by default.
- ✗
The web server's security group does not allow outbound traffic to the database server.
Why it's wrong here
Incorrect: Security groups are stateful; outbound traffic is allowed if inbound is allowed.
- ✓
The network ACL associated with the private subnet is blocking inbound MySQL traffic from the web server.
Why this is correct
Correct: A custom NACL can block traffic even if security groups allow it.
- ✗
The database server does not have a route to the internet gateway.
Why it's wrong here
Incorrect: Internet gateway is not needed for internal VPC communication.
Visual reference
Go deeper
Related to this question
About these practice questions
Courseiva writes every ANS-C01 question from scratch — 1,621 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on ANS-C01
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company has a VPC with a public subnet and a private subnet. The public subnet has a bastion host (EC2) with a security group that allows SSH from a specific IP range. The private subnet has an RDS instance. The company wants to enable the bastion host to connect to the RDS instance. Which TWO steps are required?
medium- A.Configure the RDS instance to use a custom DB parameter group with SSL enabled.
- ✓ B.Add a rule to the NACL for the private subnet to allow inbound traffic from the bastion host's IP.
- C.Assign a public IP address to the RDS instance.
- D.Create a route in the public subnet's route table to the RDS instance.
- ✓ E.Add a rule to the RDS security group that allows inbound traffic from the bastion host's security group.
Why B: The bastion host needs network-level access to the RDS instance. The RDS security group must allow inbound from the bastion's security group, and the bastion must be in the same VPC or have network connectivity. The NACL must allow the traffic.
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ANS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ANS-C01 exam.