A SysOps Administrator is troubleshooting a new application deployment in a VPC. A backend microservice runs on Amazon EC2 instances in private Subnet A (CIDR block ). These instances must communicate with a self-managed database cluster on EC2 instances in private Subnet B (CIDR block ) over TCP port .
The Security Groups are already configured to allow TCP port outbound from the backend Security Group, and TCP port inbound to the database Security Group. However, both subnets are associated with separate, custom Network Access Control Lists (NACLs) that block all traffic by default.
Which two changes must the Administrator make to the custom NACL rules to successfully enable communication between the subnets? (Select two.)
- In the custom NACL associated with Subnet A, add an inbound rule that allows traffic from Subnet B () on TCP ports .Answer
- In the custom NACL associated with Subnet B, add an outbound rule that allows traffic to Subnet A () on TCP ports .Answer
- CIn the custom NACL associated with Subnet A, add an outbound rule that allows traffic to Subnet B () on TCP ports .
- DIn the custom NACL associated with Subnet B, add an inbound rule that allows traffic from Subnet A () on TCP ports .
- EIn the custom NACL associated with Subnet A, add an inbound rule that allows traffic from Subnet B () on TCP port .
Answer
Add an inbound rule to Subnet A's NACL allowing TCP ports from Subnet B, and add an outbound rule to Subnet B's NACL allowing TCP ports to Subnet A.
Because Network Access Control Lists (NACLs) are stateless, they evaluate traffic in each direction independently. When the backend microservice in Subnet A initiates a connection to the database in Subnet B on TCP port , the client operating system assigns a random source port from the ephemeral port range (). The return packets sent by the database back to the client will have a destination port corresponding to this ephemeral port. Therefore, to allow the response packets through the stateless NACLs, Subnet B must allow outbound traffic on the ephemeral port range to Subnet A, and Subnet A must allow inbound traffic on the ephemeral port range from Subnet B.
Step-by-Step Solution
Key Concept
Stateless Network Access Control Lists (NACLs) require explicit rules for both outbound request and inbound response paths, specifically using ephemeral ports () for return traffic.