Understanding PACLs
Port ACLs (PACLs) are similar to Router ACLs (RACLs) but are supported and configured on Layer 2 interfaces on a switch. PACLs are supported on physical interfaces as well as on EtherChannel interfaces. PACLs are not supported on PVLANs. In addition to this, keep in mind that PACLs do not support the router access list keywordslog or reflexive .
Port ACLs perform access control on all traffic entering the specified Layer 2 port and apply only to ingress traffic on the port. However, it is important to remember that the PACL feature does not affect Layer 2 control packets (e.g. CDP) that are received on the port.
PACLs are supported in hardware only and do not apply to packets that are processed in software. When you create a PACL, an entry is created in the ACL TCAM. PACLs can be configured as either standard or extended IP ACLs or MAC ACLs. This allows you to filter IP traffic by using IP access lists and non-IP traffic by using MAC addresses.
Configuring and Applying PACLs
MAC ACLs are configured using the mac access-list extended [name] global configuration command, and then individual permit and deny statements can be used within MAC ACL configuration mode to permit or deny defined MAC addresses. If you are unable to remember how to configure standard and extended ACLs, please refer to the CCNA guide for a refresher.
These ACLs are then applied to Layer 2 ports using the [ip|mac] access-group [name|number] in interface configuration command. The following output illustrates the configuration of a PACL based on a configured IP Extended ACL on a Layer 2 port on the switch:
| VTP-Server-1(config)#ip access-list extended MY-SWITCH-PACL VTP-Server-1(config-ext-nacl)#permit udp any any VTP-Server-1(config-ext-nacl)#permit tcp any any VTP-Server-1(config-ext-nacl)#deny ip any any VTP-Server-1(config-ext-nacl)#exit VTP-Server-1(config)#interface gigabitethernet 3/1 VTP-Server-1(config-if)#switchport VTP-Server-1(config-if)#switchport mode access VTP-Server-1(config-if)#switchport access vlan 15 VTP-Server-1(config-if)#ip access-group MY-SWITCH-PACL in |
The following output illustrates how to configure a MAC ACL and apply it inbound to a Layer 2 port:
| VTP-Server-1(config)#mac access-list extended MY-MAC-PACL VTP-Server-1(config-ext-macl)#permit host 1a2b.1111.cdef any VTP-Server-1(config-ext-macl)#exit VTP-Server-1(config)#interface gigabitethernet 3/1 VTP-Server-1(config)#switchport mode access VTP-Server-1(config)#switchport access vlan 7 VTP-Server-1config-if)#mac access-group MY-MAC-PACL in |
NOTE: You cannot apply more than one IP access list and one MAC access list to a Layer 2 interface. If an IP access list or MAC access list is already configured on a Layer 2 interface and you apply a new IP access list or MAC access list to the interface, the new ACL replaces the previously configured one.
Configuring the PACL Access Group Mode
Cisco IOS software allows administrators to use the access-group mode interface configuration command to change the way PACLs interact with other ACLs, such as VLAN ACLs (VACLs), that may be configured for the VLAN that the Layer 2 interface is also configured for. In a per-interface fashion, the access-group mode command can be implemented with one of the following keywords in Catalyst 4500 series switches:
-
The prefer port keyword—if a PACL is configured on a Layer 2 interface, then the PACL takes effect and overrides other ACLs configured on the interface or for the VLAN. If no PACL is configured on the Layer 2 interface, other features applicable to the interface are merged and applied on the interface. This is the default option.
-
The prefer vlan keyword—when used, VLAN-based ACL features take effect on the port provided they have been applied on the port and no PACLs are in effect. If no VLAN-based ACL features are applicable to the Layer 2 interface, then the PACL feature already on the interface is applied.
-
The merge keyword—this option merges applicable ACL features before they are programmed into the switch hardware. The PACL, VACL, and Cisco IOS ACLs are merged in the ingress direction.
In Catalyst 6500 series switches, the following modes are supported:
-
The prefer port keyword—if a PACL is configured on a Layer 2 interface, then the PACL takes effect and overrides other ACLs configured on the interface or for the VLAN. If no PACL is configured on the Layer 2 interface, other features applicable to the interface are merged and applied on the interface.
-
The merge keyword—this option merges applicable ACL features before they are programmed into the switch hardware. The PACL, VACL, and Cisco IOS ACLs are merged in the ingress direction. This is the default option.
The following output illustrates how to configure an interface to use prefer port mode:
| VTP-Server-1(config)#interface gigabitethernet 3/1VTP-Server-1(config)#description ‘Switchport Configured with PACL’VTP-Server-1(config-if)#access-group mode prefer port |
Understanding VACLs
VLAN Access Control Lists (VACLs) operate in a similar manner to Router ACLs (RACLs) but are a means to apply access control to packets bridged within a VLAN or routed between VLANs. Unlike RACLs, which are applied on an inbound or outbound basis, VACLs have no sense of direction and therefore apply to traffic at both ingress and egress. Within a VLAN, packets arriving on the Layer 2 interface have the VACL processed on ingress and egress. This concept is illustrated below in Figure 6-14:

Fig. 6-14. VACL Processing within the VLAN
VACLs may be used in conjunction with RACLs. In such situations, you need to understand the order in which the VACLs and the RACLs are processed in order to ensure that the implemented configuration works in the manner expected. Figure 6-15 below illustrates the processing order of a packet when both RACLs and VACLs are configured on the switch:

Fig. 6-15. Processing RACLs and VACLs
Referencing Figure 6-15, the following sequence of steps is performed:
-
Data is received on the Layer 2 port in VLAN 2. This is matched against the configured VACL for VLAN 2 in the inbound direction.
-
The data is destined to another VLAN and must be routed. It is forwarded to the route processor and matched against the ingress RACL configured on VLAN interface 2.
-
After packet lookup has determined interface VLAN 4 as the outbound interface, the data is matched against the outbound RACL configured on interface VLAN 4.
-
The data is then matched against the VACL applied to VLAN 4 in the egress direction. The data is forwarded out of the port in VLAN 4.
Configuring and Applying VACLs
VACLs are processed in switch hardware and therefore do not cause any performance impact when implemented on switches. VACL configuration is straightforward and is performed in four simple steps, as follows:
-
Create the extended IP ACL that matches the desired packets using either the IP or MAC address against one or more standard or extended access lists;
-
Configure the VLAN access map, which is an ordered list of entries, that will be used to match against configured ACLs. This is performed via the vlan access-map [name] [number] global configuration command. The [name] is a user-defined string and can be any value. The [number] represents the sequence number of the map entry. This can range from 0 to 65,535. If you are creating a VLAN map and the sequence number is not specified, it is automatically assigned in increments of 10, starting from 10. This number is the sequence to insert into, or delete from, a VLAN access map entry;
-
Configure the VLAN access map to drop or forward the packets matched in the ACL by using the action [drop|forward] VLAN access map configuration command; and
-
Apply a VLAN map to one or more VLANs by using the vlan filter [map-name] vlan-list [list-of-vlans]global configuration command.
The following output illustrates how to configure a VACL that matches an ACL that permits all TCP traffic and apply the VACL to VLAN 22:
| VTP-Server-1(config)#ip access-list extended ALLOW-TCP VTP-Server-1(config-ext-nacl)#permit tcp any any VTP-Server-1(config-ext-nacl)#exit VTP-Server-1(config)#vlan access-map MY-VACL-MAP VTP-Server-1(config-access-map)#match ip address ALLOW-TCP VTP-Server-1(config-access-map)#action forward VTP-Server-1(config-access-map)#exit VTP-Server-1(config)#vlan filter map VLAN-22-MAP vlan-list 22 |
The following output illustrates how to configure a VACL that matches three different ACLs. The first ACL allows all TCP traffic, the second ACL denies all UDP traffic, and the third ACL permits all IP traffic. This VACL is then applied to VLAN 22:
| VTP-Server-1(config)#ip access-list extended ALLOW-TCP VTP-Server-1(config-ext-nacl)#permit tcp any any VTP-Server-1(config-ext-nacl)#exit VTP-Server-1(config)#ip access-list extended ALLOW-UDP VTP-Server-1(config-ext-nacl)#permit udp any any VTP-Server-1(config-ext-nacl)#exit VTP-Server-1(config)#ip access-list extended ALLOW-IP VTP-Server-1(config-ext-nacl)#permit ip any any VTP-Server-1(config-ext-nacl)#exit VTP-Server-1(config)#vlan access-map MY-VACL-MAP 10 VTP-Server-1(config-access-map)#match ip address ALLOW-TCP VTP-Server-1(config-access-map)#action forward VTP-Server-1(config-access-map)#exit VTP-Server-1(config)#vlan access-map MY-VACL-MAP 20 VTP-Server-1(config-access-map)#match ip address ALLOW-UDP VTP-Server-1(config-access-map)#action drop VTP-Server-1(config-access-map)#exit VTP-Server-1(config)#vlan access-map MY-VACL-MAP 30 VTP-Server-1(config-access-map)#match ip address ALLOW-IP VTP-Server-1(config-access-map)#action forward VTP-Server-1(config-access-map)#exit VTP-Server-1(config)#vlan filter map VLAN-22-MAP vlan-list 22 |
NOTE: The same filtering illustrated above could be configured in the manner illustrated in the following output:
| VTP-Server-1(config)#ip access-list extended ALLOW-UDP VTP-Server-1(config-ext-nacl)#permit udp any any VTP-Server-1(config-ext-nacl)#exit VTP-Server-1(config)#vlan access-map MY-VACL-MAP 10 VTP-Server-1(config-access-map)#match ip address ALLOW-UDP VTP-Server-1(config-access-map)#action drop VTP-Server-1(config-access-map)#exit VTP-Server-1(config)#vlan access-map MY-VACL-MAP 20 VTP-Server-1(config-access-map)#action drop VTP-Server-1(config-access-map)#exit VTP-Server-1(config)#vlan filter map VLAN-22-MAP vlan-list 22 |
Because no ACL is specifically matched in sequence 20, all traffic that is not dropped in sequence 10 is effectively forwarded. This would include the TCP and IP traffic.
Verifying VACL Configuration
The show vlan access-map command is used to view VACL configuration. The information printed by this command is illustrated in the following output:
| VTP-Server-1#show vlan access-mapVlan access-map ” MY-VACL-MAP ” 10 Match clauses: ip address: ALLOW-TCP Action: forwardVlan access-map ” MY-VACL-MAP ” 20 Match clauses: ip address: ALLOW-UDP Action: drop |