Standard or extended
How it's read
- Top to bottom, one line at a time.
- The first line that matches decides. Nothing below it is read.
- No match: the implicit deny any at the end drops it.
- An ACL with no lines, or one that doesn't exist, permits everything.
Applying it
ip access-group 10 in or out, under the interface.
- Direction is the router's view: in is arriving on that interface, out is leaving it.
- One ACL per interface, per direction, per protocol. A new one replaces the old.
- Replies cross ACLs too.
Wildcard masks
- 0.0.0.0
- That host exactly (host 10.1.10.20)
- 0.0.0.255
- A /24
- 0.0.0.15
- A block of 16
- 255.255.255.255
- Anything (any)
Wildcard = 255.255.255.255 minus the subnet mask. A 0 bit must match, a 1 bit is ignored.
Ports by name
| www | TCP 80 |
| telnet | TCP 23 |
| 22 | TCP, SSH |
| 443 | TCP, HTTPS |
| domain | UDP 53 (and TCP 53) |
| ftp | TCP 21 |
Operators: eq, neq, lt, gt, range.
Editing named lists
- Lines are numbered 10, 20, 30…
show access-lists shows the numbers and the matches.
5 deny … puts a line above 10.
no 20 removes just line 20.
no access-list 10 removes all of numbered ACL 10.
Commands
Numbered
access-list 10 deny host 10.1.10.20
access-list 10 permit any
access-list 110 permit tcp 10.1.10.0 0.0.0.255 host 10.2.20.100 eq www
access-list 110 deny ip any any
Named
ip access-list extended WEB
permit tcp any host 10.2.20.100 eq 443
5 deny icmp any any
no 20
interface gi0/0
ip access-group WEB in
Verify
show access-lists
show ip access-lists WEB
show ip interface gi0/0
show running-config
clear access-list counters
All of these work in the network's consoles, along with ?, Tab, do and ping.