A private subnet's network ACL has one inbound rule: allow TCP 443 from 10.0.1.0/24. Its outbound rules were 'mirrored' from inbound: allow TCP 443 to 10.0.1.0/24, and nothing else. The instance's security group allows inbound TCP 443 from 10.0.1.0/24. Clients in 10.0.1.0/24 open a connection to the instance on port 443 and it times out during the TCP handshake. Why?
- Network ACLs only filter traffic that crosses the internet gateway, so these rules are irrelevant and the failure is a routing problem. A NACL evaluates every packet entering or leaving its subnet, including traffic from other subnets in the same VPC.
- The NACL must also allow ICMP; without it the TCP handshake cannot negotiate MSS and never completes. The three-way handshake carries MSS inside TCP options; ICMP matters for path-MTU discovery and ping, not for SYN/SYN-ACK.
- Network ACLs are stateless: the SYN-ACK goes back to the client's ephemeral source port (1024–65535), which the outbound rule for port 443 does not match, so the subnet drops it. Add an outbound allow for TCP 1024–65535 to 10.0.1.0/24. Each direction is evaluated independently by a NACL; return traffic needs its own rule covering the client's ephemeral port range.
- The security group needs a matching outbound rule for TCP 443 so the reply can leave the instance. Security groups are stateful: replies to an allowed inbound connection are permitted regardless of outbound rules.
Network ACLs are stateless, so the reply needs its own outbound rule for the client's ephemeral ports 1024-65535.
Security groups attach to an ENI and are stateful: connection tracking lets the reply to an allowed inbound flow leave without an outbound rule. Network ACLs attach to a subnet and are stateless: inbound and outbound rule lists are evaluated separately, in ascending rule-number order, first match wins. A client's connection arrives on port 443 but its reply travels to the client's ephemeral port, so the outbound list needs a rule for 1024–65535 (the range AWS documents for ELBs and NAT gateways; Linux clients use a subset of it). The interview tell is a candidate who "mirrors" inbound rules to outbound and cannot explain why the handshake stalls.
'Mirroring' the inbound rule to outbound on the same port. The reply goes to the client's ephemeral port, not to the service port, so the SYN-ACK is dropped and the handshake times out.