A SysOps Administrator is troubleshooting a connectivity issue between an Application Load Balancer (ALB) in a public subnet () and a fleet of web servers running on Amazon EC2 instances in a private subnet (). Users are reporting HTTP Gateway Timeout errors when attempting to access the application.
The Administrator reviews the VPC Flow Logs for the web servers' subnet and observes the following entries:
| version | srcaddr | dstaddr | srcport | dstport | protocol | packets | bytes | action | log-status |
|---|---|---|---|---|---|---|---|---|---|
| 2 | 10.0.1.50 | 10.0.2.10 | 51243 | 80 | 6 | 1 | 40 | ACCEPT | OK |
| 2 | 10.0.2.10 | 10.0.1.50 | 80 | 51243 | 6 | 1 | 40 | REJECT | OK |
What configuration change is required to resolve this connectivity issue?
- Add an outbound rule to the Network ACL associated with the private subnet to allow outbound traffic to the public subnet () on ephemeral ports ().Cevap
- BAdd an outbound rule to the security group associated with the web server instances to allow outbound traffic to the public subnet () on ephemeral ports ().
- CAdd an outbound route in the private subnet's route table targeting the Internet Gateway () for the destination range ().
- DAssociate a Gateway VPC Endpoint with the private subnet's route table to allow direct routing of response traffic to the public subnet.
Cevap
Add an outbound rule to the Network ACL associated with the private subnet to allow outbound traffic to the public subnet () on ephemeral ports ().
The VPC Flow Logs reveal that inbound traffic from the ALB () to the web server () is accepted, but the outbound response is rejected. Because Security Groups are stateful, they automatically allow response traffic for any permitted inbound connection. However, Network ACLs are stateless and require explicit rules in both directions. The rejection of the outbound response indicates that the private subnet's Network ACL is missing an outbound rule. The rule must permit outbound traffic to the ephemeral ports () used by the ALB to receive the response.
Adım Adım Çözüm
Anahtar Kavram
VPC Network ACLs are stateless security controls that evaluate inbound and outbound traffic independently. Allowed inbound connections require matching outbound rules for the ephemeral port range () to successfully return response traffic.