What Is an AWS Network ACL? Manage Subnet Traffic and Return Rules
An AWS VPC network access control list (network ACL or NACL) is a set of rules that allows or denies inbound and outbound traffic at a subnet boundary. A NACL is stateless: it does not remember a connection, so allowing a request does not automatically allow its response. This is the key difference from a security group, which is associated with an instance or network interface and tracks permitted connections.
An AWS VPC network access control list (network ACL or NACL) is a set of rules that allows or denies inbound and outbound traffic at a subnet boundary. A NACL is stateless: it does not remember a connection, so allowing a request does not automatically allow its response. This is the key difference from a security group, which is associated with an instance or network interface and tracks permitted connections.
Where and how does a NACL apply?
Each subnet is associated with one NACL at a time. A VPC's default NACL is automatically associated with a new subnet, while a custom NACL can be associated with one or more subnets. NACLs are evaluated when traffic enters or leaves a subnet; they do not inspect traffic routed within the same subnet.
Each NACL has separate inbound and outbound rule lists. A rule contains a number, protocol, port range, source or destination CIDR, and an allow or deny action. Rules are evaluated from the lowest number upward. The action of the first matching rule applies, and later rules are not checked. A broad allow rule placed first can therefore make a narrower deny rule below it ineffective.
| Part | Scope and behavior | What to check |
|---|---|---|
| Inbound rules | Evaluate traffic entering the subnet | Source CIDR, protocol, destination port, and rule order |
| Outbound rules | Evaluate traffic leaving the subnet | Destination CIDR, protocol, destination port, and return path |
| Rule number | The lowest numbered matching rule is applied first | Leave gaps between numbers so rules can be inserted later |
Star (*) rule | Denies traffic that matches no numbered rule | A custom NACL blocks traffic unless an explicit allow rule matches |
IPv4 and IPv6 rules are evaluated separately. An IPv4 allow or deny rule does not affect IPv6 traffic. If the subnet has an IPv6 CIDR, review both address families.
Why can the response fail even when the request is allowed?
Because a NACL is stateless, an allow in one direction does not automatically permit the response in the other direction. For example, if an internet client connects to TCP port 443 on a web server, an inbound rule allowing port 443 is only part of the configuration. The server's response is addressed to the temporary (ephemeral) port chosen by the client, so an outbound rule must allow the relevant port range and client destination.
Similarly, if an instance in the subnet initiates a request to an external server, the inbound NACL rules might need to allow the response to the instance's ephemeral destination port. The range depends on the operating system or service that initiated the request. AWS documents different ranges for some Linux and Windows systems, load balancers, NAT gateways, and Lambda. Choose a range based on the actual clients; do not open a wide range without checking the traffic flow and operating-system requirements.
By contrast, a security group is stateful, so response traffic for a permitted connection passes automatically. AWS describes security groups as the primary instance-level control and NACLs as an additional subnet-level layer or a way to deny selected traffic. When both are used, the connection must also pass the route, NACL, security group, operating-system firewall, and any other applicable control.
Defaults for default and custom NACLs
The default NACL for a VPC has numbered rules that allow all inbound and outbound traffic for associated subnets. A custom NACL uses a default star rule that denies unmatched traffic, so required communication must be explicitly allowed. Both types deny traffic that matches no numbered rule. The default NACL can be modified, so inspect its actual rules rather than relying on its name.
A NACL also cannot block all AWS platform traffic. AWS documents exceptions such as Route 53 Resolver DNS, DHCP, and instance metadata. For metadata access, review EC2 instance metadata options; for DNS filtering, use a purpose-built feature such as Route 53 Resolver DNS Firewall.
Example: HTTPS servers in a web subnet
This is an illustrative assumption. Suppose a subnet contains a public web server that accepts HTTPS from internet clients. An inbound NACL rule allows TCP 443 from the intended source range. The response packets are sent to the clients' ephemeral ports, so an outbound rule must allow that response traffic. If IPv6 clients are supported, configure the corresponding IPv6 CIDR rules separately.
If inbound 443 is allowed but outbound response ports are not, packets may reach the server while the browser receives no response. Conversely, allowing a broad ephemeral-port range to a broad destination can permit more traffic than necessary. Choose the response rules after checking the actual client and server operating systems, any load balancer in the path, and the source ranges. This example explains the mechanism; it is not a test result from a specific environment.
What should you check before and after a NACL change?
Before changing rules, identify the NACL actually associated with the subnet and list every subnet associated with that NACL. One NACL can be shared across multiple subnets, so a rule change may affect more than one workload. Review inbound and outbound entries in ascending rule-number order, and confirm that the first matching rule produces the intended action. If a wide port range is needed, distinguish service ports from ephemeral response ports and place any deny exception at a lower rule number than the broad allow.
After applying the change, test request and response directions separately. For a failed connection, first review route tables and gateways, then find the first matching NACL rule in each direction. Next check the instance security group, operating-system firewall, service listener, and relevant logs. Validate the change on a limited scope, and keep a way to restore the previous association or rules if service connectivity does not recover.
An AWS network ACL is a stateless control for broadly allowing or denying traffic at a subnet boundary. Missing the rule order or the return-path ports can interrupt a service. Used alongside security groups, and with defaults, IPv4/IPv6, and response paths checked, a NACL can serve as an additional defense layer.
Sources
[AWS: Control subnet traffic with network ACLs](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html)
[AWS: Network ACL rules](https://docs.aws.amazon.com/vpc/latest/userguide/nacl-rules.html)
[AWS: Default network ACL](https://docs.aws.amazon.com/vpc/latest/userguide/default-network-acl.html)
[AWS: Custom network ACLs and ephemeral ports](https://docs.aws.amazon.com/vpc/latest/userguide/custom-network-acl.html)
[AWS: Manage network ACL associations for a VPC](https://docs.aws.amazon.com/vpc/latest/userguide/network-acl-associations.html)
[AWS: Compare VPC security groups and network ACLs](https://docs.aws.amazon.com/vpc/latest/userguide/infrastructure-security.html)