Stateless ACL matching
A rule is a decision about a packet
An access control list (ACL) is a set of conditions and actions used to control traffic. A stateless packet filter decides using the current packet and configured context, without needing a record of earlier packets in the conversation. A rule can match source and destination IP addresses, protocol, and, for TCP or UDP, ports. In the fictional policy below, a visitor subnet may reach one web server over TCP 443, except one explicitly excluded address. The list is evaluated from top to bottom and ends with a deny default. These are paper rules, not a deployable configuration.
10 DENY 192.0.2.9/32 -> 198.51.100.20/32 TCP 44320 ALLOW 192.0.2.0/24 -> 198.51.100.20/32 TCP 443Default: DENYEvaluate the first matching rule
For a packet from 192.0.2.9 to 198.51.100.20 over TCP with destination port 443, rule 10 matches and evaluation stops. A packet from 192.0.2.8 with the same destination matches rule 20 instead. Changing the destination port to 80 prevents both matches, so the default denies it. UDP 443 is different from TCP 443. If rule 20 were placed first, the specific exclusion would never be reached for its matching packets. This ordering is a documented behavior of conventional Cisco IOS XE IP ACLs; other policy engines can have different evaluation semantics. A rule that never gets reached for its intended traffic is shadowed.
192.0.2.9 -> 198.51.100.20 TCP 443 : DENY (10)192.0.2.8 -> 198.51.100.20 TCP 443 : ALLOW (20)192.0.2.8 -> 198.51.100.20 UDP 443 : DENY (default)Direction and default action
Inbound and outbound are relative to the interface where a filter is attached, not relative to a user or the Internet. On a router, a packet arriving from the visitor network is inbound on the visitor interface and outbound on the server interface when forwarded. Its reply travels in the opposite directions. A normal Cisco IPv4 ACL with entries has an implicit deny at the end; this is not a universal rule for all firewalls, and empty or missing ACLs have special behavior on some platforms. nftables base chains have a configured policy and more complex interactions between chains. An allow decision at one filter is not proof of end-to-end reachability.
Visitor -> [in: visitor interface | router | out: server interface] -> ServerCisco wildcard masks are not CIDR masks
In a Cisco IPv4 ACL wildcard, a zero bit requires equality and a one bit ignores that position. For a contiguous /27 block, the subnet mask is 255.255.255.224 and the wildcard is 0.0.0.31. Thus base 192.0.2.64 matches addresses 64 through 95 inclusive, including the network and broadcast addresses as bit patterns; the match does not mean they are ordinary usable hosts. A wildcard of 0.0.0.0 matches one exact address. Some wildcard masks can be noncontiguous and cannot be expressed as a single CIDR prefix. Do not reuse this notation on a different platform without checking its syntax.
CIDR: 192.0.2.64/27Subnet mask: 255.255.255.224Cisco wildcard: 0.0.0.31192.0.2.95: match192.0.2.96: no matchPractice: predict, then review
For the original rule list, predict the action for 192.0.2.10 sending TCP 443 to 198.51.100.21. It is denied by default because the destination differs. Always check address family, direction, protocol, rule order and default action before proposing a change. Use a reviewed policy diff and positive and negative test cases rather than broadening permissions to make a symptom disappear. This simplified example assumes unfragmented IPv4 packets with transport headers present; real devices have specific fragment handling. Sources: Cisco IOS XE 3S ACL overview and sequence-number documentation; nftables manual.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Stateless ACL matching — knowledge check
Apply concepts to fictional firewall policy scenarios.
Which decision applies to 192.0.2.9 sending TCP 443 to 198.51.100.20 in the lesson list?
If rule 20 is placed before rule 10, what happens to the specific exclusion?
Which wildcard corresponds to a contiguous IPv4 /27 mask on Cisco?
A packet enters the router from the visitor network. Which direction is it on that interface?
What happens to UDP 443 in the lesson ACL?