Port ACLs, VLAN ACLs, and Layer 2 Traffic Filtering
CCNP Enterprise | Cisco CCNP 350-401 (ENCOR) & 300-410 (ENARSI)
This lab demonstrates how to control traffic at the switch access layer and VLAN level using Port ACLs (PACLs), VLAN ACLs (VACLs), and routed ACLs (RACLs). Students will learn how to filter traffic entering a switch port, restrict traffic within a VLAN, and compare the policy scope of each ACL type.
Use the provided topology image for this lab.
! On SW1, SW2, and SW3
conf t
vlan 10
name MGMT
vlan 20
name USERS
vlan 30
name SERVERS
exit
! SW1 trunk to SW2
interface g0/1
description Trunk to SW2
switchport mode trunk
switchport trunk allowed vlan 10,20,30
exit
! SW2 trunk links
interface g0/1
description Trunk to SW1
switchport mode trunk
switchport trunk allowed vlan 10,20,30
exit
interface g0/2
description Trunk to SW3
switchport mode trunk
switchport trunk allowed vlan 20,30
exit
! SW3 trunk to SW2
interface g0/2
description Trunk to SW2
switchport mode trunk
switchport trunk allowed vlan 20,30
exit
end
! SW1 access ports
conf t
interface g1/0
description PC1
switchport mode access
switchport access vlan 20
exit
interface g1/1
description PC2
switchport mode access
switchport access vlan 20
exit
end
! SW3 access ports
conf t
interface g1/1
description Server
switchport mode access
switchport access vlan 30
exit
interface g1/2
description Rogue PC
switchport mode access
switchport access vlan 20
exit
interface g1/3
description Router
exit
end
! Example PACL to block Telnet and ICMP, but allow all other IP traffic at SW1
conf t
ip access-list extended PACL_USERS
deny tcp any any eq 23
deny icmp any any
permit ip any any
exit
! Apply inbound on user-facing access ports
interface g1/0
ip access-group PACL_USERS in
exit
interface g1/1
ip access-group PACL_USERS in
exit
end
mac access-list extended and apply it with mac access-group ... in.
! Example MAC ACL on an access port in SW1
conf t
mac access-list extended MAC_ACL_USERS
permit host 00:1A:2B:3C:4D:5E any
deny any
exit
interface g1/0
mac access-group MAC_ACL_USERS in
exit
end
! Create ACLs used by the VACL in SW3
conf t
ip access-list extended ICMP
deny icmp any any
permit ip any any
exit
ip access-list extended TELNET
deny tcp any any eq 23
permit ip any any
exit
ip access-list extended OTHER
permit ip any any
exit
! Create the VLAN access-map
vlan access-map VACL_20 10
match ip address ICMP
action drop
exit
vlan access-map VACL_20 20
match ip address TELNET
action drop log
exit
vlan access-map VACL_20 30
match ip address OTHER
action forward
exit
! Apply VACL to VLAN 20
vlan filter VACL_20 vlan-list 20
end
! Example routed ACL for the router interface
conf t
ip access-list extended RACL_OUT
deny tcp any any eq 23
permit ip any any
exit
interface g1/3
description Router Interface
ip access-group RACL_OUT in
exit
end
| Check | Command | Expected Result |
|---|---|---|
| VLANs created | show vlan brief |
VLAN 10, 20, and 30 appear |
| Trunks operational | show interfaces trunk |
G0/1 and G0/2 show trunking and allowed VLANs |
| PACL applied | show running-config interface g1/0 |
ip access-group PACL_USERS in is present |
| PACL counters | show access-lists PACL_USERS |
Hit counts increase when blocked traffic is sent |
| MAC ACL check | show mac access-list |
Permitted MAC entry appears if using MAC ACL |
| VACL created | show vlan access-map |
VACL_20 sequences displayed |
| VACL applied | show vlan filter |
VACL_20 is bound to VLAN 20 |
| RACL applied | show running-config interface g1/3 |
RACL_OUT appears on router interface |
| Traffic test | Ping / Telnet / ICMP tests | Denied traffic is blocked, permitted traffic succeeds |
vlan filter VACL_20 vlan-list 20 and check rule order
show access-lists