Course contentsShow
← Security
Lesson 1823 of 3,05237. Cloud Security - Network ArchitectureFree lesson

Network ACL Rule Ordering and Evaluation

How rules are processed sequentially by number, early termination on match, and common ordering mistakes to avoid.

Network ACL Rule Ordering and Evaluation

You'll learn how Network ACLs process traffic rules sequentially and why rule order matters critically.

Network ACLs evaluate rules in strict numeric order, starting from the lowest rule number and stopping at the first match. This is fundamentally different from Security Groups, which evaluate all rules together. Think of it like reading a checklist from top to bottom and acting on the first instruction that applies—everything below gets ignored.

How Rule Processing Works

Each Network ACL rule has a number (1, 100, 200, etc.). When a packet arrives, the ACL checks rule #1 first. If the packet matches that rule's criteria (protocol, port, source/destination), the associated action (ALLOW or DENY) is applied immediately, and evaluation stops. If no match, it moves to rule #2, then #3, and so on.

The final rule is always a wildcard "deny all" (rule * or 32767), catching anything that didn't match earlier rules.

Critical Ordering Mistakes

Never place broad rules before specific ones. If rule #100 allows all traffic from 0.0.0.0/0, rule #200 denying traffic from 10.0.0.5 will never execute—the allow already matched.

Common error pattern:

  • Rule 100: DENY specific malicious IP
  • Rule 200: ALLOW all inbound HTTP

This works correctly. But reverse them, and the malicious IP gets allowed before the DENY is checked.

Leave gaps in numbering (use 100, 200, 300 instead of 1, 2, 3) so you can insert emergency rules between existing ones without renumbering everything.

Evaluation is Per-Direction

Remember: inbound and outbound rules are evaluated separately. A packet entering a subnet checks inbound rules; a packet leaving checks outbound rules. Both must allow the traffic.

Key Takeaway: Network ACL rules execute in numerical order with immediate termination on first match—always place more specific DENY rules before broader ALLOW rules, and number with gaps for flexibility.