Match order
The rules in an ACL are sorted in a specific order. When a packet matches a rule, the device stops the match process and performs the action defined in the rule. If an ACL contains overlapping or conflicting rules, the matching result and action to take depend on the rule order.
The following ACL match orders are available:
config—Sorts ACL rules in ascending order of rule ID. A rule with a lower ID is matched before a rule with a higher ID. If you use this method, check the rules and their order carefully.
auto—Sorts ACL rules in depth-first order. Depth-first ordering makes sure any subset of a rule is always matched before the rule. Table 1 lists the sequence of tie breakers that depth-first ordering uses to sort rules for each type of ACL.
Table 1: Sort ACL rules in depth-first order
ACL type
Sequence of tie breakers
IPv4 basic ACL
More 0s in the source IPv4 address wildcard (more 0s means a narrower IPv4 address range).
Rule configured earlier.
IPv4 advanced ACL
Specific protocol number.
More 0s in the source IPv4 address wildcard mask.
More 0s in the destination IPv4 address wildcard.
Narrower TCP/UDP service port number range.
Rule configured earlier.
IPv6 basic ACL
Longer prefix for the source IPv6 address (a longer prefix means a narrower IPv6 address range).
Rule configured earlier.
IPv6 advanced ACL
Specific protocol number.
Longer prefix for the source IPv6 address.
Longer prefix for the destination IPv6 address.
Narrower TCP/UDP service port number range.
Rule configured earlier.
Layer 2 ACL
More 1s in the source MAC address mask (more 1s means a smaller MAC address).
More 1s in the destination MAC address mask.
Rule configured earlier.
A wildcard mask, also called an inverse mask, is a 32-bit binary number represented in dotted decimal notation. In contrast to a network mask, the 0 bits in a wildcard mask represent "do care" bits, and the 1 bits represent "don't care" bits. If the "do care" bits in an IP address are identical to the "do care" bits in an IP address criterion, the IP address matches the criterion. All "don't care" bits are ignored. The 0s and 1s in a wildcard mask can be noncontiguous. For example, 0.255.0.255 is a valid wildcard mask.