An application running on Amazon EC2 instances in a private subnet () must consume an internal web service hosted on EC2 instances in a database/services subnet () on TCP port 8080. The security groups for both tiers are correctly configured. A custom Network Access Control List (NACL) associated with the private subnet () has an outbound rule allowing TCP port 8080 to , and an inbound rule allowing TCP port 8080 from . The default deny rule is active. The instances cannot establish a connection. Which configuration change must be made to the private subnet's NACL to resolve this connectivity issue?
- Modify the inbound rule of the private subnet's NACL to allow TCP traffic from on destination ports .Answer
- BNo NACL changes are required because Security Groups are stateful and will automatically permit the inbound response traffic.
- CModify the outbound rule of the private subnet's NACL to allow TCP traffic to on destination ports .
- DModify the inbound rule of the private subnet's NACL to allow TCP traffic from on source ports .
Answer
Modify the inbound rule of the private subnet's NACL to allow TCP traffic from on destination ports .
The correct option is to modify the inbound rule of the private subnet's NACL to allow TCP traffic from the destination subnet on destination ports in the ephemeral range (). Because NACLs are stateless, they require explicit inbound rules to allow the return traffic of an outbound connection. When a client initiates a connection to a server on port 8080, the return traffic sent by the server will have a source port of 8080 and a destination port within the ephemeral port range () allocated by the client's operating system.
Step-by-Step Solution
Key Concept
Stateless Network Access Control Lists (NACLs) require explicit rules for both inbound and outbound traffic, including allowing return traffic on ephemeral port ranges.