AWS Certified Solutions Architect - Associate Exam: Possible Reasons for EC2 Instance Communication Issue between Private Subnets

Troubleshooting EC2 Instance Communication Issue between Private Subnets in AWS VPC

Prev Question Next Question

Question

Your organization already had a VPC(10.10.0.0/16) setup with one public(10.10.1.0/24) and two private subnets - private subnet 1 (10.10.2.0/24) and private subnet 2 (10.10.3.0/24)

The public subnet has the main route table, and two private subnets have two different route tables respectively.

AWS sysops team reports a problem starting the EC2 instance in private subnet 1 cannot communicate to the RDS MySQL database on private subnet 2

What are the possible reasons? (choose 2 options)

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: B, C.

For.

Option A, for any route table, the local route cannot be edited or deleted.

AWS Docs says:

"Every route table contains a local route for communication within the VPC over IPv4

If your VPC has more than one IPv4 CIDR block, your route tables contain a local route for each IPv4 CIDR block.

If you've associated an IPv6 CIDR block with your VPC, your route tables contain a local route for the IPv6 CIDR block.

You cannot modify or delete these routes."

https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Route_Tables.html#RouteTa

For Option B, possible because the security group is configured with a public subnet IP range instead of a private subnet 1 IP range, and EC2 is in private subnet 1

So EC2 will not be able to communicate with RDS in private subnet 2.

Option C is correct.

https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html#default-network-

Option D is not correct because Security Groups are stateful.

If you send a request from your instance, the response traffic for that request is allowed to flow in regardless of inbound security group rules.

Responses to allowed inbound traffic are allowed to flow out, regardless of outbound rules.

https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html#VPCSecurityGroups
Inbound
Rule # Type Protocol Port Range Source Allow/Deny
100 All IPv4 traffic All All 0.0.0.0/0 ALLOW

* All IPv4 traffic All All 0.0.0.0/0 DENY

The problem is that an EC2 instance in private subnet 1 cannot communicate with an RDS MySQL database in private subnet 2. To determine the possible reasons, we need to consider the network configurations and security group settings for both subnets.

Option A: One of the private subnet route table's local route has been changed to restrict access only within the subnet IP range. Explanation: If the local route for one of the private subnets is changed to restrict access only within the subnet IP range, it will prevent communication between the two private subnets. The EC2 instance in private subnet 1 will not be able to reach the RDS MySQL database in private subnet 2. This could be a possible reason for the issue.

Option B: RDS security group inbound rule is incorrectly configured with 10.10.1.0/24 instead of 10.10.2.0/24. Explanation: If the RDS security group inbound rule is configured with the wrong subnet IP range (10.10.1.0/24 instead of 10.10.2.0/24), the EC2 instance in private subnet 1 will not be able to communicate with the RDS MySQL database in private subnet 2. This could be a possible reason for the issue.

Option C: 10.10.3.0/24 subnet's NACL is modified to deny inbound on port 3306 from subnet 10.10.2.0/24 Explanation: If the network access control list (NACL) for the private subnet 2 (10.10.3.0/24) is modified to deny inbound traffic on port 3306 from the private subnet 1 (10.10.2.0/24), the EC2 instance in private subnet 1 will not be able to communicate with the RDS MySQL database in private subnet 2. This could be a possible reason for the issue.

Option D: RDS Security group outbound does not contain a rule for ALL traffic or port 3306 for 10.10.2.0/24 IP range. Explanation: If the RDS security group outbound rule does not contain a rule for all traffic or port 3306 for the 10.10.2.0/24 IP range, the EC2 instance in private subnet 1 will not be able to communicate with the RDS MySQL database in private subnet 2. However, this option is less likely to be the reason for the issue since the problem is with the inbound traffic from the EC2 instance to the RDS database.

Therefore, options A and B are the most likely reasons for the problem. The solution would be to check the local route of the private subnets and the inbound rules of the RDS security group to ensure that they are configured correctly.