Free tech learning for everyone, from basics to pro

Networking LabsLabsIntermediate

Lab: standard and extended access control lists

In short: Access control lists (ACLs) filter traffic by matching packet fields. In this lab you use a standard ACL to allow only staff to manage the router, and an extended ACL to let students reach a web server on HTTP and HTTPS but nothing else in the server VLAN.

Aim and what you need

The aim is to turn a written policy into ACL lines, apply them in the right place and direction, and prove they work with hit counters. The policy for this lab is:

  1. Only the STAFF network may open SSH sessions to the router.
  2. STUDENTS may reach the web server 192.168.30.10 on TCP 80 and 443 only, and nothing else in the SERVERS VLAN.
  3. All other traffic between VLANs is allowed.
  • The inter-VLAN routing lab extended with a third VLAN (30, SERVERS) and subinterface g0/0.30 at 192.168.30.1.
  • SSH already configured on R1 (as in the switch SSH lab).

Design

Standard versus extended ACLsStandard ACLMatches source IP onlyPlace near destinationGood for VTY accessNumbers 1-99, or namedExtended ACLSource, destination, portPlace near sourcePrecise traffic controlNumbers 100-199, or named
Figure 1. Standard ACLs are simple but coarse; extended ACLs match protocols and ports and can be placed close to the traffic source.
ACL lab topologyR1router-on-a-stickVLAN 10 STAFF192.168.10.0/24VLAN 20 STUDENTS192.168.20.0/24VLAN 30 SERVERS192.168.30.0/24VTY linesSSH management
Figure 2. R1 routes three VLANs; one extended ACL filters students and one standard ACL protects management access.

Every ACL ends with an invisible implicit deny: anything not permitted is dropped. Lines are checked top to bottom and the first match wins, so put specific lines before general ones.

Steps

  1. Write the policy as lines on paper first, including what must still be allowed.
  2. Create the standard ACL for management and apply it to the VTY lines with access-class.
  3. Create the extended ACL and apply it inbound on the STUDENTS subinterface, close to the source.
  4. Test allowed and denied traffic, then read the counters.
ip access-list standard MGMT-SSH
 remark Only STAFF may manage R1
 permit 192.168.10.0 0.0.0.255
 deny any log
line vty 0 15
 access-class MGMT-SSH in
exit
ip access-list extended STUDENTS-IN
 remark Students: web only to the server VLAN
 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 80
 permit tcp 192.168.20.0 0.0.0.255 host 192.168.30.10 eq 443
 deny ip 192.168.20.0 0.0.0.255 192.168.30.0 0.0.0.255 log
 permit ip any any
interface g0/0.20
 ip access-group STUDENTS-IN in
end

Check wildcard masks with the wildcard mask calculator and port numbers with the port lookup.

Verify

From a student PC, browse to http://192.168.30.10 (should work) and ping 192.168.30.10 (should fail). From a staff PC, SSH to R1 (should work); from a student PC, SSH to R1 (should be refused). Success also means the matching lines show increasing match counts.

show access-lists
show ip interface g0/0.20
show running-config | section line vty
clear access-list counters
ping 192.168.30.10
ssh -l admin 192.168.10.1

Troubleshooting and clean-up

  • Everything from students is blocked: you forgot the final permit ip any any, so the implicit deny caught it.
  • Nothing is blocked: the ACL is applied in the wrong direction or on the wrong subinterface. show ip interface shows what is applied.
  • Return traffic fails: a basic ACL is stateless. If you filter in the other direction, allow replies (for example with the established keyword for TCP).
  • Locked yourself out over SSH: on real kit, use reload in 10 before risky changes, and reload cancel once you have confirmed access.

To clean up, remove the bindings first (no ip access-group STUDENTS-IN in, no access-class MGMT-SSH in), then delete the lists. Named ACLs let you insert or remove single lines by sequence number, which is why most engineers prefer them at work.

Practice

Why is an extended ACL placed near the source?
Because it matches destination and port precisely, it can drop unwanted traffic early without affecting other flows.
What happens to traffic that matches no line in an ACL?
It is dropped by the implicit deny at the end.
Which command applies an ACL to the VTY lines?
access-class <name> in under line vty 0 15.

Key takeaways

  • Write the policy first, then translate it into ordered ACL lines.
  • Standard ACLs match source only; extended ACLs match source, destination, protocol and port.
  • Every ACL ends with an implicit deny; first match wins.
  • Use access-group on interfaces and access-class on VTY lines.
  • Verify with hit counters in show access-lists.
Tracks your learning on this device only. See your progress on the learning paths.

About the author

Mohamed Fayas

Founder of FM TecHub. CCNA certified, with a BTEC HND in Network Engineering, and BEng (Hons) in Computer Networking and Cloud Security. He writes practical, plain-English guides on networking, security and cloud.

More about the author

Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.

Stay up to date by email

New notes, tools and security news from FM TecHub, explained simply. Free.

We only use your email to send these updates. See our privacy policy.