12.1 IPv4 and IPv6 Access Control Lists (ACLs): Standard, Extended, and Named Rules
Key Takeaways
Access Control Lists (ACLs) enforce packet filtering at Layer 3 and Layer 4 interfaces using sequential, top-down rule evaluation that halts immediately upon the first matching permit or deny statement.
Standard IPv4 ACLs (numbered 1–99 and 1300–1999) evaluate source IP addresses exclusively and are placed closest to the destination, whereas Extended IPv4 ACLs (numbered 100–199 and 2000–2699) filter source IP, destination IP, protocol, and Layer 4 port numbers and are placed closest to the source.
Named ACLs (
ip access-list standard/extended <name>) provide modern editing flexibility by indexing rules with sequence numbers, allowing administrators to insert, delete, and resequence entries without recreating the list.Wildcard masks invert traditional subnet masks (0 means match exactly; 1 means ignore bit value) and support discontiguous bit patterns to match arbitrary IP groups, with host denoting a 0.0.0.0 mask and any denoting 255.255.255.255.
IPv6 ACLs (
ipv6 access-list <name>) are exclusively named, use CIDR prefix lengths rather than wildcard masks, and feature invisible implicit permits for ICMPv6 Neighbor Discovery (ND-NS and ND-NA) that precede the final implicit deny ipv6 any any.
IPv4 and IPv6 Access Control Lists (ACLs): Standard, Extended, and Named Rules
Access Control Lists (ACLs) represent the foundational security mechanism deployed on enterprise routers and multilayer switches to inspect, permit, or discard transit traffic traversing network interfaces. Operating primarily at Layer 3 (Network) and Layer 4 (Transport) of the OSI model, ACLs provide deterministic traffic filtering, protect core subnets from unauthorized access, partition broadcast domains, and serve as traffic classification engines for Quality of Service (QoS), Network Address Translation (NAT), and Control Plane Policing (CoPP). Mastering ACL rule mechanics, placement architecture, wildcard calculation, and protocol-specific nuances between IPv4 and IPv6 is essential for securing enterprise infrastructure.
Core ACL Architecture and Packet Filtering Principles
An Access Control List consists of an ordered sequence of permit and deny statements, commonly referred to as Access Control Entries (ACEs). When an interface receives or transmits a packet, the router parses the packet header fields against the configured ACEs according to strict operational tenets:
Incoming/Outgoing Packet
│
▼
┌───────────────────┐
│ Evaluate ACE 10 │───[Match]───► Action: Permit (Forward) or Deny (Drop)
└───────────────────┘
│ [No Match]
▼
┌───────────────────┐
│ Evaluate ACE 20 │───[Match]───► Action: Permit (Forward) or Deny (Drop)
└───────────────────┘
│ [No Match]
▼
┌───────────────────┐
│ Evaluate ACE 30 │───[Match]───► Action: Permit (Forward) or Deny (Drop)
└───────────────────┘
│ [No Match]
▼
┌──────────────────────────────────────────────┐
│ Implicit Deny (End of ACL) │
│ (deny ip any any / deny ipv6 any any) │───► Action: Silently Drop Packet
└──────────────────────────────────────────────┘
- Sequential Top-Down Processing: The packet filtering engine parses ACEs sequentially, starting from the lowest sequence number and proceeding downward. Rules are never evaluated out of order.
- First-Match Termination: As soon as a packet satisfies all matching criteria of an ACE (source address, destination address, protocol, and port numbers), the designated action (
permitordeny) is executed immediately. The device ceases all further evaluation for that packet. Subsequent rules with more specific or conflicting definitions are ignored. - Implicit Deny at End of ACL: Every IPv4 and IPv6 ACL automatically concludes with an invisible default deny statement (
deny ip any anyfor IPv4;deny ipv6 any anyfor IPv6). Any packet that does not match an explicitpermitstatement is silently discarded. If an ACL contains onlydenystatements, it will drop 100% of all evaluated traffic. - Directional Interface Binding: ACLs are applied to interfaces in either the inbound (
in) or outbound (out) direction. Inbound ACLs inspect packets immediately upon arrival at the ingress interface before the routing lookup occurs, conserving CPU and switching fabric resources. Outbound ACLs inspect packets after the routing engine determines the egress interface and rewrites the Layer 2 header, just prior to placing the frame onto the transmit queue.
Standard vs. Extended IPv4 Access Control Lists
IPv4 ACLs are categorized into two primary architectural types based on the depth of header inspection they perform:
Standard IPv4 ACLs
Standard ACLs inspect source IPv4 addresses exclusively. They cannot evaluate destination IP addresses, upper-layer transport protocols (TCP/UDP/ICMP), or Layer 4 port numbers.
- Numbered Ranges: Legacy Standard ACLs use number ranges
1–99and the expanded range1300–1999. - Architectural Placement Rule: Standard ACLs must be placed as close to the destination as possible. Because standard ACLs lack destination filtering, placing a standard ACL near the traffic source risks inadvertently blocking that source from reaching other valid network destinations reachable through that same ingress path.
Extended IPv4 ACLs
Extended ACLs provide granular policy enforcement by evaluating multiple Layer 3 and Layer 4 header fields:
- Source and Destination IP Addresses: Specific hosts, subnets, or wildcard-masked address blocks.
- Protocol Type: IP, TCP, UDP, ICMP, IGMP, GRE, ESP, and OSPF.
- Layer 4 Port Numbers: Source and destination ports using logical operators such as
eq(equal),neq(not equal),gt(greater than),lt(less than), andrange(inclusive port range). - TCP Control Flags: Inspection of TCP control flags, such as the
establishedkeyword, which checks whether the ACK or RST flags are set, verifying that the packet belongs to an existing bidirectional session. - Numbered Ranges: Extended ACLs use number ranges
100–199and the expanded range2000–2699. - Architectural Placement Rule: Extended ACLs must be placed as close to the source as possible. By dropping unauthorized traffic at the network edge nearest the initiating host, extended ACLs prevent denied packets from traversing the enterprise backbone, conserving intermediate bandwidth and router processing capacity.
ACL Types Comparison
| Attribute | Standard IPv4 ACL | Extended IPv4 ACL | Named IPv4 ACL | IPv6 ACL |
|---|---|---|---|---|
| Numeric Identifier Range | 1–99, 1300–1999 | 100–199, 2000–2699 | None (Alphanumeric String) | None (Alphanumeric String) |
| Inspection Criteria | Source IPv4 only | Source/Dest IP, L4 Protocol, Ports, TCP Flags | Matches Standard or Extended rules | Source/Dest IPv6, Next Header, L4 Ports |
| Masking Format | Wildcard Mask (e.g., 0.0.0.255) | Wildcard Mask (e.g., 0.0.0.255) | Wildcard Mask (e.g., 0.0.0.255) | Prefix Length (e.g., /64) |
| Recommended Placement | Closest to Destination | Closest to Source | Closest to Source (Extended) | Closest to Source |
| Sequence Number Editing | Yes, but only in ip access-list standard <number> mode | Yes, but only in ip access-list extended <number> mode | Yes (insert, delete, resequence) | Yes (insert, delete, resequence) |
| Implicit End Rules | deny ip any any | deny ip any any | Matches type (deny ip any any) | permit ND-NA, permit ND-NS, deny ipv6 any any |
Named ACLs and Sequence Number Management
Legacy numbered ACLs exhibit severe operational limitations: adding a rule appends it to the very bottom, and deleting a single rule using no access-list <number> deletes the entire ACL. Modern IOS XE also lets you edit numbered ACLs by sequence number, but only from ip access-list configuration mode. Cisco IOS XE resolves this through Named ACLs, configured via ip access-list standard <name> or ip access-list extended <name>.
Named ACLs index every ACE with a distinct sequence number (defaulting to increments of 10: 10, 20, 30...):
! Defining an extended named ACL with automatic sequence numbering
Router(config)# ip access-list extended BRANCH-FILTER
Router(config-ext-nacl)# 10 permit tcp 10.10.10.0 0.0.0.255 host 192.168.1.50 eq 443
Router(config-ext-nacl)# 20 permit tcp 10.10.10.0 0.0.0.255 host 192.168.1.50 eq 22
Router(config-ext-nacl)# 30 deny ip 10.10.10.0 0.0.0.255 192.168.1.0 0.0.0.255
Router(config-ext-nacl)# 40 permit ip any any
Granular Insertion and Deletion
Administrators can insert a new rule between existing statements without rebuilding the list by specifying an intermediate sequence number, or remove an isolated statement using no <sequence-number>:
! Insert a permit statement for DNS queries between sequence 10 and 20
Router(config)# ip access-list extended BRANCH-FILTER
Router(config-ext-nacl)# 15 permit udp 10.10.10.0 0.0.0.255 host 192.168.1.10 eq 53
! Delete the SSH rule at sequence 20
Router(config-ext-nacl)# no 20
Resequencing ACL Entries
When repeated insertions consume available sequence gaps, the global EXEC command ip access-list resequence restructures the sequence numbering across the entire list:
! Syntax: ip access-list resequence <name> <starting-sequence> <step-increment>
Router(config)# ip access-list resequence BRANCH-FILTER 10 10
Wildcard Masks and Calculation Mechanics
IPv4 ACLs utilize wildcard masks (inverse masks) to determine which bits in an IP address must match the configured rule and which bits can be ignored:
- Bit value 0: Match the corresponding bit in the IP address exactly.
- Bit value 1: Ignore the corresponding bit ("do not care").
Wildcard Mask Calculation Method
To calculate the wildcard mask for a standard contiguous IPv4 subnet, subtract each octet of the traditional subnet mask from 255.255.255.255:
For a /27 subnet (subnet mask 255.255.255.224):
255 . 255 . 255 . 255
- 255 . 255 . 255 . 224
-----------------------
0 . 0 . 0 . 31
Keywords: host and any
host <ip-address>: Represents a single host IP with wildcard mask0.0.0.0(all 32 bits must match exactly). For example,permit ip host 10.1.1.1 anyis identical topermit ip 10.1.1.1 0.0.0.0 any.any: Matches any IP address, utilizing base IP0.0.0.0with wildcard mask255.255.255.255(all 32 bits are ignored).
Discontiguous Wildcard Masks
Wildcard masks do not require contiguous blocks of binary zeros and ones. Network engineers can construct discontiguous wildcard masks to match non-standard groupings. For example, to match all even-numbered third octets in the 172.16.0.0/16 network:
- Even numbers end in binary 0. Setting the least significant bit of the third octet to 0 forces an exact match on even values, while setting all other bits to 1 ignores them.
- Resulting wildcard:
0.0.254.255(binary third octet:11111110). - Rule:
permit ip 172.16.0.0 0.0.254.255 anymatches172.16.0.0,172.16.2.0,172.16.4.0, etc.
Wildcard Mask Calculation Reference
| Prefix Length | Subnet Mask | Wildcard Mask | Binary Fourth Octet (Mask / Wildcard) | Matched Host Count |
|---|---|---|---|---|
| /32 | 255.255.255.255 | 0.0.0.0 (host) | 11111111 / 00000000 | 1 (Single Host) |
| /30 | 255.255.255.252 | 0.0.0.3 | 11111100 / 00000011 | 4 addresses (2 usable) |
| /28 | 255.255.255.240 | 0.0.0.15 | 11110000 / 00001111 | 16 addresses |
| /26 | 255.255.255.192 | 0.0.0.63 | 11000000 / 00111111 | 64 addresses |
| /24 | 255.255.255.0 | 0.0.0.255 | 00000000 / 11111111 | 256 addresses |
| /20 | 255.255.240.0 | 0.0.15.255 | 3rd: 11110000 / 00001111 | 4,096 addresses |
| /16 | 255.255.0.0 | 0.0.255.255 | 3rd & 4th: all wildcard bits 1 | 65,536 addresses |
| /0 | 0.0.0.0 | 255.255.255.255 (any) | All 32 bits wildcard 1 | Entire IPv4 Address Space |
IPv6 Access Control Lists Architecture and Implicit Rules
IPv6 ACLs introduce major architectural modernizations over IPv4 implementations:
- No Numbered ACLs: All IPv6 ACLs are strictly named. Numbered ranges do not exist in IPv6.
- Unified Feature Set: There is no division between standard and extended ACLs. Every IPv6 ACL natively supports matching source IPv6, destination IPv6, Next Header protocol, and Layer 4 ports.
- Prefix Length Notation: Wildcard masks are eliminated. IPv6 ACLs designate subnets using standard CIDR prefix lengths (e.g.,
2001:db8:acad:10::/64) or theanyandhost <ipv6>keywords.
The Critical IPv6 Implicit Rules
Unlike IPv4 ACLs, which contain only a single implicit deny statement, every IPv6 ACL ends with three invisible implicit rules:
permit icmp any any nd-na
permit icmp any any nd-ns
deny ipv6 any any
These statements are essential for basic IPv6 connectivity:
permit icmp any any nd-na: Permits ICMPv6 Neighbor Discovery Neighbor Advertisement messages.permit icmp any any nd-ns: Permits ICMPv6 Neighbor Discovery Neighbor Solicitation messages.deny ipv6 any any: Silently discards all remaining unmatched IPv6 traffic.
Caution
In IPv6, Address Resolution Protocol (ARP) is replaced by ICMPv6 Neighbor Discovery Protocol (NDP). If an administrator enters an explicit deny ipv6 any any or deny ipv6 any any log at the end of a named IPv6 ACL, that statement overrides the two invisible implicit ND permits! This immediately breaks Layer 2-to-Layer 3 address resolution, causing all IPv6 neighbor adjacencies and connectivity across the link to drop. When configuring explicit logging at the end of an IPv6 ACL, you must manually permit nd-ns and nd-na prior to the explicit deny statement.
IPv4 vs. IPv6 ACL Architectural Matrix
| Functional Dimension | IPv4 Access Control Lists | IPv6 Access Control Lists |
|---|---|---|
| Configuration Syntax | ip access-list standard / extended <name> | ipv6 access-list <name> |
| Interface Binding Command | ip access-group <name / number> in / out | ipv6 traffic-filter <name> in / out |
| Addressing Mask Syntax | Wildcard masks (e.g., 0.0.0.255) | Prefix length notation (e.g., /64) |
| Single Host Representation | host 10.1.1.1 or 10.1.1.1 0.0.0.0 | host 2001:db8::1 or 2001:db8::1/128 |
| Implicit Rules at End | deny ip any any | 1. permit icmp any any nd-na; 2. permit icmp any any nd-ns; 3. deny ipv6 any any |
| Address Resolution Impact | Implicit deny does NOT affect ARP (Layer 2 ARP bypasses L3 IPv4 ACLs) | Overriding implicit rules drops ICMPv6 NDP, breaking Layer 2-to-Layer 3 resolution |
Advanced Filtering: Time-Based and State-Aware ACLs
Enterprise networks frequently require dynamic access policies governed by temporal schedules or session state:
Time-Based ACLs
Time-based ACLs activate or deactivate specific ACEs based on the system clock. They reference a pre-configured time-range object defined with either absolute timestamps or recurring weekly schedules:
! Step 1: Define recurring business hours schedule
Router(config)# time-range WORK-HOURS
Router(config-time-range)# periodic weekdays 08:00 to 17:00
! Step 2: Reference the time-range in an extended ACL
Router(config)# ip access-list extended CORP-ACCESS
Router(config-ext-nacl)# 10 permit tcp 10.1.1.0 0.0.0.255 any eq 80 time-range WORK-HOURS
Router(config-ext-nacl)# 20 permit tcp 10.1.1.0 0.0.0.255 any eq 443 time-range WORK-HOURS
Router(config-ext-nacl)# 30 deny tcp 10.1.1.0 0.0.0.255 any eq 80
Router(config-ext-nacl)# 40 deny tcp 10.1.1.0 0.0.0.255 any eq 443
Outside of Monday through Friday 08:00 to 17:00, sequence statements 10 and 20 are dynamically deactivated, causing web traffic to fall through to statements 30 and 40 for termination.
TCP Established Filtering
To allow internal hosts to initiate outbound connections while preventing external untrusted endpoints from establishing inbound sessions, extended ACLs support the established keyword:
Router(config-ext-nacl)# permit tcp any 10.1.1.0 0.0.0.255 established
The established match condition inspects the TCP header flags. It matches if either the ACK (Acknowledgment) or RST (Reset) flag is set to 1. Because initial TCP connection attempts (SYN packets) have ACK=0 and RST=0, external attackers cannot initiate new TCP handshakes into the protected subnet.
Complete CLI Configuration and Interface Binding Walkthrough
The following configuration illustrates the complete deployment of both IPv4 and IPv6 ACLs, verifying rules and binding them to operational interfaces:
! Step 1: Configure Named IPv4 Extended ACL
ip access-list extended WAN-INBOUND-V4
remark Permit return traffic for established TCP sessions
10 permit tcp any 10.200.1.0 0.0.0.255 established
remark Permit inbound HTTPS to corporate DMZ web server
20 permit tcp any host 10.200.1.50 eq 443
remark Permit secure management SSH from trusted NOC subnet
30 permit tcp 192.168.100.0 0.0.0.255 host 10.200.1.1 eq 22
remark Permit ICMP echo-reply and unreachable
40 permit icmp any 10.200.1.0 0.0.0.255 echo-reply
50 permit icmp any 10.200.1.0 0.0.0.255 unreachable
60 deny ip any any log-input
! Step 2: Configure Named IPv6 ACL with explicit ND safety
ipv6 access-list WAN-INBOUND-V6
remark Permit established TCP return traffic
sequence 10 permit tcp any 2001:db8:cafe:1::/64 established
remark Permit HTTPS to IPv6 DMZ server
sequence 20 permit tcp any host 2001:db8:cafe:1::50 eq 443
remark Explicitly permit ICMPv6 Neighbor Discovery prior to logging deny
sequence 30 permit icmp any any nd-na
sequence 40 permit icmp any any nd-ns
sequence 50 deny ipv6 any any log-input
! Step 3: Apply ACLs to Physical Interface
interface GigabitEthernet0/0/1
description Primary Enterprise WAN Ingress
ip address 198.51.100.2 255.255.255.252
ipv6 address 2001:db8:ffff::2/64
! Apply IPv4 ACL using ip access-group
ip access-group WAN-INBOUND-V4 in
! Apply IPv6 ACL using ipv6 traffic-filter
ipv6 traffic-filter WAN-INBOUND-V6 in
Verification and Diagnostic Commands
To audit active access lists, evaluate sequence numbers, and inspect hit counters for security validation:
show access-lists: Displays all configured IPv4 and IPv6 access lists, showing ACE sequence numbers and real-time packet match counters.show ip access-list [name]: Filters output to IPv4 access lists only.show ipv6 access-list [name]: Displays IPv6 access lists and explicit ACE match counters.clear access-list counters [name]: Resets hit count statistics to zero to establish an active monitoring baseline during troubleshooting.
A network engineer needs to filter traffic on an enterprise router to restrict human resources workstations (10.10.20.0/24) from accessing internal payroll application servers (172.16.50.10) over TCP port 8443, while allowing all other traffic to proceed normally. What ACL type and interface placement strategy provides optimal resource efficiency?
A standard IPv4 ACL placed on the router interface closest to the human resources workstations
An extended IPv4 ACL placed on the router interface closest to the human resources workstations
A standard IPv4 ACL placed on the router interface closest to the payroll application server
An extended IPv4 ACL placed on the router interface closest to the payroll application server
An administrator configures a named IPv6 access list to block unauthorized transit traffic and enters the statement sequence 90 deny ipv6 any any log-input at the end of the rule list. Immediately upon applying this ACL inbound on an interface, all IPv6 connectivity across the link fails, and the router stops resolving IPv6 link-local addresses. What caused this operational failure?
IPv6 access lists do not support the log-input parameter and enter an error-disabled state
The router requires an ip access-group command rather than ipv6 traffic-filter to process IPv6 rules
The wildcard mask applied to the deny statement failed to match IPv6 hexadecimal notation
The explicit deny statement overrode the invisible implicit permits for ICMPv6 Neighbor Solicitation and Advertisement
An engineer needs to match all host IP addresses within the subnet 192.168.64.0/20 in an extended IPv4 access list. Which wildcard mask correctly identifies this subnet range?
0.0.15.255
0.0.31.255
0.0.63.255
255.255.240.0
Sections you finish are checked off in the contents.