Access Control List
Access Control List
An ACL is a set of rules on a Cisco router or switch used to filter network traffic or control routing updates. It
defines which packets are permitted or denied based on criteria like source/destination IP addresses,
protocols, or ports. ACLs are used in scenarios like:
• Security: Block unauthorized access (e.g., deny traffic from a specific IP).
• Policy-Based Routing (PBR): Match traffic for route-maps (as in your previous question).
• Route Filtering: Control which routes are advertised or accepted in routing protocols.
Cisco supports several types of ACLs, categorized by how they’re defined and applied. Here are the main
types:
1. Standard ACL:
2. Extended ACL:
o Filters traffic based on source and destination IP addresses, protocol (e.g., TCP, UDP),
ports, and other parameters.
3. Named ACL:
4. Dynamic ACL:
5. Reflexive ACL:
o Dynamically allows return traffic for sessions initiated inside a network (e.g., for stateful-like
filtering).
6. Time-Based ACL:
o Applies rules based on time schedules (e.g., allow traffic only during business hours).
Note: Standard and extended ACLs (both numbered and named) are the most commonly used. Dynamic,
reflexive, and time-based ACLs are more specialized and less frequent in basic configurations.
This example creates a standard named ACL to permit traffic from the IT department (192.168.1.0/24) and
deny all other traffic, then applies it to an interface to filter incoming traffic.
o Deny all other traffic (optional, as there’s an implicit deny): deny any
o Command: exit
Key Points:
• Implicit Deny: All ACLs end with an implicit deny any, so explicitly permit desired traffic.
• Direction: ACLs can be applied in (incoming traffic) or out (outgoing traffic) on an interface.
• Order Matters: Rules are evaluated sequentially. Place more specific rules (e.g., permit 192.168.1.10)
before general ones (e.g., deny 192.168.1.0 0.0.0.255).
• Editing Named ACLs: Use show running-config to view the ACL, then re-enter ip access-list standard
IT_ACL to add or modify rules.
Below is an ASCII diagram illustrating the ACL filtering traffic on a Cisco router. The ACL IT_ACL permits
traffic from 192.168.1.0/24 (IT Dept) and denies other traffic entering GigabitEthernet0/0.
Additional Tips:
• Standard vs. Extended: Use standard ACLs for simple source-based filtering; use extended ACLs for
complex scenarios involving protocols or destinations.
• Placement: Place standard ACLs close to the destination, extended ACLs close to the source for
efficiency.
• Troubleshooting: Use show ip access-lists to see hit counts for rules, indicating which traffic is
matching.
Overview
• Modifying an ACL: Involves adding, removing, or changing rules within an existing ACL. For named
ACLs, you can directly edit specific lines. For numbered ACLs, you may need to delete and recreate the
ACL (in older IOS versions) or use sequence numbers (in newer IOS versions).
• Deleting an ACL: Involves removing the entire ACL or specific rules, ensuring it’s also removed from
any interfaces where it’s applied.
Let’s assume you have a named standard ACL called IT_ACL from the previous example, with rules:
Steps to Modify:
o Example output:
o Add a rule to permit the host with a specific sequence number (e.g., 5, to place it before
existing rules):
o Add a new rule with the updated subnet: 10 permit 192.168.1.0 0.0.0.63
o Note: Named ACLs allow direct editing of specific sequence numbers, unlike older numbered
ACLs.
o Expected output:
3. Verify Deletion:
Notes:
• Numbered ACLs (Older IOS): For numbered ACLs (e.g., access-list 1 permit 192.168.1.0 0.0.0.255),
you cannot edit individual lines. You must delete the entire ACL (no access-list 1) and recreate it. In
newer IOS versions, sequence numbers allow editing similar to named ACLs.
• Sequence Numbers: Use show ip access-lists to see sequence numbers. If you don’t specify a
sequence number when adding a rule, it’s appended to the end (e.g., sequence 30).
• Implicit Deny: After removing the explicit deny any, the implicit deny still applies unless you add a
permit any rule.
• Caution: Removing an ACL from an interface without replacing it may allow all traffic, posing a
security risk.
Below is an ASCII diagram showing the effect of the modified ACL IT_ACL on traffic entering the router. The
modified ACL permits traffic from 192.168.2.10 and 192.168.1.0/26, denying all other traffic implicitly.
Additional Tips:
• Testing Changes: Use show ip access-lists to check hit counts (e.g., 10 permit 192.168.1.0 0.0.0.63
(50 matches)) to confirm traffic is matching as expected.
• Debugging: Use debug ip packet detail cautiously to troubleshoot ACL behavior, ensuring you have a
specific ACL to limit output.
• Backup: Before modifying ACLs, save the running configuration (copy running-config startup-config)
to avoid accidental loss.