![]() |
Contents
- Configuring MAC ACLs
- Prerequisites for MAC ACLs
- Guidelines and Limitations for MAC ACLs
- Default Settings for MAC ACLs
- Configuring MAC ACLs
- Creating a MAC ACL
- Changing a MAC ACL
- Removing a MAC ACL
- Changing Sequence Numbers in a MAC ACL
- Applying a MAC ACL as a Port ACL
- Adding a MAC ACL to a Port Profile
- Verifying MAC ACL Configurations
- Monitoring MAC ACLs
- Configuration Examples for MAC ACLs
- Configuration Example for Creating a MAC ACL for any Protocol
- Feature History for MAC ACLs
Configuring MAC ACLs
This chapter contains the following sections:
- Prerequisites for MAC ACLs
- Guidelines and Limitations for MAC ACLs
- Default Settings for MAC ACLs
- Configuring MAC ACLs
- Verifying MAC ACL Configurations
- Monitoring MAC ACLs
- Configuration Examples for MAC ACLs
- Feature History for MAC ACLs
Configuring MAC ACLs
Creating a MAC ACL
Use this procedure to create a MAC ACL and add rules to it. You can also use this procedure to add the ACL to a port profile.
Before You BeginProcedureBefore beginning this procedure, you must be sure you have done the following:
- Logged in to the CLI in EXEC mode.
- Have a name to assign to the ACL you are creating.
- Created a port profile if you want to add the ACL to it.
If you want to also add the ACL to a port-profile, you must know the following:
switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. switch(config)# mac access-list acl-mac-01 switch(config-mac-acl)# permit 00c0.4f00.0000 0000.00ff.ffff any switch(config-mac-acl)# statistics per-entry switch(config-mac-acl)# show mac access-lists acl-mac-01 MAC ACL acl-mac-01 statistics per-entry 10 permit 00c0.4f00.0000 0000.00ff.ffff any switch# copy running-config startup-configChanging a MAC ACL
ProcedureUse this procedure to change an existing MAC ACL, for example, to add or remove rules.
Use the resequence command to reassign sequence numbers, such as when adding rules between existing sequence numbers.
switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. switch(config)# show mac access-lists MAC ACL acl-mac-01 statistics per-entry 10 permit 00c0.4f00.0000 0000.00ff.ffff any switch(config)# mac access-list acl-mac-01 switch(config-mac-acl)# permit f866.f222.e5a6 ffff.ffff.ffff any switch(config-mac-acl)# no 10 switch(config-mac-acl)# no statistics per-entry switch(config-mac-acl)# end switch# show mac access-lists MAC ACL acl-mac-01 20 permit f866.f222.e5a6 ffff.ffff.ffff any switch# copy running-config startup-configRemoving a MAC ACL
ProcedureYou can remove a MAC ACL from the switch. Be sure that you know whether the ACL is applied to an interface. The switch allows you to remove ACLs that are current applied. Removing an ACL does not affect the configuration of interfaces where you have applied the ACL. Instead, the switch considers the removed ACL to be empty.
To find the interfaces that a MAC ACL is configured on, use the show mac access-lists command with the summary keyword.
Changing Sequence Numbers in a MAC ACL
ProcedureUse this procedure to change sequence numbers assigned to rules in a MAC ACL. Resequencing is useful when you need to insert rules into an ACL and there are not enough available sequence numbers.
switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. switch(config)# show mac access-lists acl-mac-01 MAC ACL acl-mac-01 10 permit 00c0.4f00.0000 0000.00ff.ffff any 20 permit f866.f222.e5a6 ffff.ffff.ffff any switch(config)# resequence mac access-list acl-mac-01 100 10 switch(config)# show mac access-lists acl-mac-01 MAC ACL acl-mac-01 100 permit 00c0.4f00.0000 0000.00ff.ffff any 110 permit f866.f222.e5a6 ffff.ffff.ffff any switch(config)# copy running-config startup-configApplying a MAC ACL as a Port ACL
You can apply a MAC ACL as a port ACL to any of the following interface types:ProcedureA MAC ACL can also be applied to a port-profile attached to a physical Ethernet interface or a virtual Ethernet interface.
Note: ACL cannot be applied on Port-channel interface. However it can be applied on a physical ethernet interface which is not part of the portchannel.
switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. switch(config)# interface ethernet 1 switch(config-if)# mac port access-group acl-mac-01 in switch(config-if)# show running-config aclmgr !Command: show running-config aclmgr !Time: Wed Mar 13 03:38:02 2013 version 5.2(1)SK1(2.1) mac access-list acl-mac-01 100 permit 00C0.4F00.0000 0000.00FF.FFFF any 110 permit F866.F222.E5A6 FFFF.FFFF.FFFF any interface Vethernet1 mac port access-group acl-mac-01 in switch(config-if)# copy running-config startup-configAdding a MAC ACL to a Port Profile
Before You BeginProcedureBefore beginning this procedure, be sure you have done the following:
- Logged in to the CLI in EXEC mode.
- Created the MAC ACL to add to this port profile and know its name.
- If you are using an existing port profile, know its name.
- If you are creating a new port profile, know the interface type (Ethernet or vEthernet) and the name you want to give the profile.
- Know the direction of packet flow for the access list.
switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. switch(config)# port-profile vm_eth1 switch(config-port-prof)# mac port access-group acl-mac-01 out switch(config-port-prof)# show port-profile name vm_eth1 port-profile vm_eth1 type: Vethernet description: status: enabled max-ports: 32 min-ports: 1 inherit: config attributes: mac port access-group acl-mac-01 out no shutdown evaluated config attributes: mac port access-group acl-mac-01 out no shutdown assigned interfaces: port-group: vm_eth1 system vlans: none capability l3control: no capability iscsi-multipath: no capability vxlan: no capability l3-vn-service: no port-profile role: none port-binding: static switch(config-port-prof)# copy running-config startup-configVerifying MAC ACL Configurations
Use one of the following commands to verify the configuration:
Command
Purpose
show mac access-lists
Displays the MAC ACL configuration.
show mac address-lists summary
Displays a summary of all configured MAC ACLs or a named MAC ACL.
show running-config aclmgr
Displays the ACL configuration, including MAC ACLs and the interfaces they are applied to.
show running-config interface
Displays the configuration of the interface to which you applied the ACL.
Monitoring MAC ACLs
Use the following commands for MAC ACL monitoring:
Command
Purpose
show mac access-lists
Displays the MAC ACL configuration. If the MAC ACL includes the statistics per-entry command, the show mac access-lists command output includes the number of packets that have matched each rule.
clear mac access-list counters
Clears statistics for all MAC ACLs or for a specific MAC ACL.
Configuration Examples for MAC ACLs
Configuration Example for Creating a MAC ACL for any Protocol
This example shows how to create a MAC ACL named acl-mac-01 and apply it as a port ACL on a physical Ethernet interface that is not a member of a port-channel and configuration verification with match counters:
switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. switch(config)# mac access-list acl-mac-01 switch(config-mac-acl)# 100 permit 00c0.4f00.0000 0000.00ff.ffff any switch(config-mac-acl)# 110 permit f866.f222.e5a6 ffff.ffff.ffff any switch(config-mac-acl)# statistics per-entry switch(config-mac-acl)# end switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. switch(config)# interface ethernet 3/5 switch(config-if)# mac port access-group acl-mac-01 out switch(config-if)# show mac access-lists acl-mac-01 summary MAC ACL acl-mac-01 statistics per-entry Total ACEs Configured:2 Configured on interfaces: Ethernet3/5 - egress (Port ACL) Active on interfaces: Ethernet3/5 - egress (Port ACL) switch(config-if)# show mac access-lists acl-mac-01 MAC ACL acl-mac-01 statistics per-entry 100 permit 00c0.4f00.0000 0000.00ff.ffff any [match=0] 110 permit f866.f222.e5a6 ffff.ffff.ffff any [match=546] switch(config-if)# clear mac access-list counters switch(config-if)# show mac access-lists acl-mac-01 MAC ACL acl-mac-01 statistics per-entry 100 permit 00c0.4f00.0000 0000.00ff.ffff any [match=0] 110 permit f866.f222.e5a6 ffff.ffff.ffff any [match=0] switch(config-if)#