Prerequisites
- A Cisco IOS router or L3 switch routing between the VLANs
- The VLAN addressing plan
01How an ACL is read
Lines are evaluated top to bottom, and the first match decides: the following lines are not read. An ACL always ends with an implicit deny of everything not permitted, invisible in the configuration.
An extended ACL filters on source, destination, protocol and ports. It goes as close to the source as possible, to stop traffic before it crosses the network.
02The guest ACL
Guests (10.30.0.0/24) may query the internal resolver, then the whole private network is denied to them, then the Internet is open. Order is essential: the DNS line must come before the 10.0.0.0/8 deny.
The inverse mask (wildcard) marks free bits with 1: 0.0.0.255 covers a /24, 0.15.255.255 a /12.
ip access-list extended GUESTS-IN
remark Guests: internal DNS, then Internet only
10 permit udp 10.30.0.0 0.0.0.255 host 10.10.0.53 eq domain
20 permit tcp 10.30.0.0 0.0.0.255 host 10.10.0.53 eq domain
30 deny ip 10.30.0.0 0.0.0.255 10.0.0.0 0.255.255.255
40 deny ip 10.30.0.0 0.0.0.255 172.16.0.0 0.15.255.255
50 deny ip 10.30.0.0 0.0.0.255 192.168.0.0 0.0.255.255
60 permit ip 10.30.0.0 0.0.0.255 any
!
interface Vlan30
ip access-group GUESTS-IN in03An ACL has no memory
Unlike a stateful firewall, an ACL doesn’t remember connections. Here it doesn’t matter: it only filters what comes in from the guest VLAN, and server replies arrive on other interfaces.
To allow only replies in the other direction, the established keyword lets through TCP segments carrying ACK or RST: a stateless approximation. For real connection tracking you need IOS zone-based firewall (ZBFW) or a dedicated firewall.
04Edit without rewriting everything
Sequence numbers let you insert a line between two others, or remove one, without detaching the ACL from the interface.
ip access-list extended GUESTS-IN
25 permit icmp 10.30.0.0 0.0.0.255 host 10.10.0.53 echo
no 50
!
ip access-list resequence GUESTS-IN 10 1005Verify
Each line has its match counter: a line that stays at zero is either useless or shadowed by a broader line above. Adding log to a final deny ip any any line makes denials visible; use it carefully, as logging loads the CPU.
show access-lists GUESTS-IN
show ip interface Vlan30 | include access listKey takeaways
- Top to bottom, the first match decides.
- An implicit deny always ends the ACL.
- Extended ACL close to the source, inbound on the interface.
- An ACL is stateless: established is only an approximation.
- Counters reveal useless or shadowed lines.
Example addresses.