5.6 Configure and verify access control lists (ACLs)

CCNA 200-301 v1.1 · 5.0 Security Fundamentals

An access control list is an ordered list of permit and deny statements. Applied to an interface, it filters packets; used elsewhere, it identifies traffic for NAT, VTY access, QoS or routing. For the CCNA you write standard and extended, numbered and named ACLs, place them in the right spot, and read the hit counters.

What you must know

How an ACL is processed

The router compares a packet with each line from the top. The first match decides, and no later line is read. A packet that matches nothing hits the invisible implicit deny any at the end, so an ACL with only deny lines blocks everything. Wildcard masks are inverted masks: 0 bits must match, 1 bits are ignored. 0.0.0.255 matches a /24; host 10.1.1.5 means 10.1.1.5 0.0.0.0; any means 0.0.0.0 255.255.255.255.

Standard and extended ACLs

TypeNumbersMatches onPlace it
Standard1–99, 1300–1999Source address onlyClose to the destination
Extended100–199, 2000–2699Protocol, source, destination, portsClose to the source
ip access-list extended BRANCH-IN
 10 permit tcp 10.1.10.0 0.0.0.255 host 10.0.50.80 eq 443
 20 deny   tcp 10.1.10.0 0.0.0.255 host 10.0.50.80 eq 22
 30 permit icmp 10.1.10.0 0.0.0.255 any echo
 40 deny   ip any any log
!
interface GigabitEthernet0/1
 ip access-group BRANCH-IN in

PC1's HTTPS request matches line 10 and reaches the server (1). Its SSH attempt matches line 20 and is dropped as it enters R1 (2), before it uses any more bandwidth: that is why extended ACLs go near the source.

Applying and editing

One ACL per interface, per direction, per protocol. In filters packets arriving on the interface, before routing; out filters packets leaving it, after routing. Named ACLs can be edited by sequence number: no 20 removes a line, 15 permit … inserts one between 10 and 20.

R1# show access-lists BRANCH-IN
Extended IP access list BRANCH-IN
    10 permit tcp 10.1.10.0 0.0.0.255 host 10.0.50.80 eq 443 (1288 matches)
    20 deny tcp 10.1.10.0 0.0.0.255 host 10.0.50.80 eq 22 (4 matches)
    30 permit icmp 10.1.10.0 0.0.0.255 any echo (12 matches)
    40 deny ip any any log

Commands

show access-listsEvery ACL with its lines, sequence numbers and match counters.
show ip interface Gi0/1Which ACLs are applied in and out on the interface.
clear access-list countersResets the counters before a test.
ip access-group NAME in|outApplies an ACL to an interface.

Exam traps

Check yourself

Write the wildcard mask for 172.16.32.0/20.
0.0.15.255.
An ACL has deny 10.1.1.0 0.0.0.255 and nothing else. What does it do on an interface?
It blocks everything: 10.1.1.0/24 by the explicit line, all else by the implicit deny.
Where do you place a standard ACL that stops one subnet from reaching one server?
As close to the server (the destination) as possible, outbound toward it, so the subnet can still reach everything else.
How do you insert a line between 10 and 20 in a named ACL?
Enter the ACL and type 15 <permit|deny …>.

Labs

Try it live: Filter traffic with standard and extended ACLs

More topics in 5.0 Security Fundamentals