Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help


title: “VPC Network ACLs” created: 2026-07-22 updated: 2026-07-22 type: knowledge tags:

  • aws
  • certification
  • networking
  • vpc

VPC Network ACLs

What It Is

A Network Access Control List (NACL) is an optional stateless firewall that controls inbound and outbound traffic at the subnet level. Every subnet in a VPC is associated with a NACL.

Why It Matters

NACLs provide an additional layer of defense beyond security groups. Understanding the difference between NACLs (stateless, subnet-level) and security groups (stateful, instance-level) is critical for both exam preparation and real-world VPC design.

Key Concepts

Stateless vs Stateful

FeatureNetwork ACLSecurity Group
LevelSubnetInstance
StatefulNo — must allow return traffic explicitlyYes — return traffic auto-allowed
Rule typeAllow AND DenyAllow only (implicit deny)
EvaluationRules processed in number orderAll rules evaluated together

Rule Structure

FieldDescription
Rule numberPriority (lower = evaluated first)
TypeTraffic type (e.g., All Traffic, HTTP, SSH)
ProtocolTCP, UDP, ICMP, etc.
Port rangeDestination port(s)
Source/DestinationCIDR block
Allow/DenyAction to take

Default NACL

The default NACL (created with the VPC) allows all inbound and outbound traffic:

Rule #DirectionActionTrafficCIDR
100InboundAllowAll0.0.0.0/0
100OutboundAllowAll0.0.0.0/0
*BothDenyAll0.0.0.0/0

The * rule is the catch-all: if no numbered rule matches, traffic is denied.

Custom NACL

A newly created custom NACL denies all traffic by default (only has the * deny rule). You must explicitly add allow rules.

Rule Evaluation Order

  1. Rules are evaluated in ascending order by rule number
  2. First matching rule wins (stops evaluation)
  3. If no rule matches, the * catch-all denies the traffic

Ephemeral Ports

Because NACLs are stateless, you must allow ephemeral ports (1024–65535) for return traffic on outbound rules when a client connects to a service.

Gotchas

  • NACLs are stateless — allowing inbound HTTP (port 80) does NOT automatically allow the response on ephemeral ports
  • The default NACL allows everything; a custom NACL denies everything — easy to confuse
  • Rule numbers should use increments (e.g., 100, 200, 300) to leave room for insertion
  • A subnet can only be associated with one NACL at a time
  • NACLs apply to all instances in the subnet — cannot target specific instances

See Also

  • [[vpc-security-groups]]
  • [[vpc-subnets]]
  • [[vpc-fundamentals]]
  • [[vpc-route-tables]]