class mac
Syntax
class mac <CLASS-NAME>
[<SEQUENCE-NUMBER>]
{match|ignore}
{any|<SRC-MAC-ADDRESS>[/<ETHERNET-MASK>}]}
{any|<DST-MAC-ADDRESS>[/<ETHERNET-MASK>}]}
{any|aarp|appletalk|arp|fcoe|fcoe-init|ip|ipv6|ipx-arpa|ipx-non-arpa|is-is|
lldp|mpls-multicast|mpls-unicast|q-in-q|rbridge|trill|wake-on-lan|
<NUMERIC-ETHERTYPE>}
[pcp <PCP-VALUE>] [vlan <VLAN-ID>] [count]
[<SEQUENCE-NUMBER>] comment <TEXT-STRING>
Description
Creates or modifies a MAC traffic class to match specified packets. Class is composed of one or more class entries ordered and prioritized by sequence numbers. With this command, each class can classify traffic based on MAC header information.
The
no
form of the command can be used to delete either a MAC traffic class (use
no
with the class command) or an individual MAC traffic class entry (use
no
with the sequence number).
Command context
config
The
class mac <CLASS-NAME>
command takes you into the
config-class-mac
context where you enter the class entries.
Parameters
mac
Specifies create or modify a MAC class.
<CLASS-NAME>
Specifies the name of this class.
<SEQUENCE-NUMBER>
Specifies a sequence number for the class entry. Optional. Range: 1-4294967295.
{match|ignore}
Creates a rule to match or ignore specified packets.
comment
Stores the remaining entered text as a class comment.
{any|<SRC-MAC-ADDRESS>[/<ETHERNET-MASK>}]}
Specifies the source host MAC address (xxxx.xxxx.xxxx), OUI, or the keyword
any
. You can optionally include the following:<ETHERNET-MASK>
- The address bits to mask (xxxx.xxxx.xxxx).
{any|<DST-MAC-ADDRESS>[/<ETHERNET-MASK>}]}
Specifies the destination host MAC address (xxxx.xxxx.xxxx), OUI, or the keyword
any
. You can optionally include the following:<ETHERNET-MASK>
- The address bits to mask (xxxx.xxxx.xxxx).
Protocol
Select an ethertype protocol from the following (enter one only):
any
- Any ethertype protocol<NUMBERIC-ETHERTYPE>
- Enter an EtherType protocol number. Range: 0x600-0xffff.Or enter an EtherType protocol name from the following list:
aarp
appletalk
arp
fcoe
fcoe-init
ip
ipv6
ipx-arpa
ipx-non-arpa
is-is
lldp
mpls-multicast
mpls-unicast
q-in-q
rbridge
trill
wake-on-lan
pcp <PCP-VALUE>
Specifies matching on QoS Priority Code Point. Range: 0-7.
vlan <VLAN-ID>
Specifies matching on a VLAN ID. Enter a VLAN ID or the VLAN name, if configured.
count
Keeps the hit counts of the number of packets matching this class entry.
Authority
Administrators
Examples
Creating a MAC class:
switch(config)# class mac MY_MAC_CLASS switch(config-class-mac)# match any any lldp switch(config-class-mac)# ignore any any arp switch(config-class-mac)# exit switch(config)# do show class Type Name Sequence Comment Action EtherType Source MAC Address Destination MAC Address Additional Parameters ------------------------------------------------------------------------------- MAC MY_MAC_CLASS 10 match lldp any any 20 ignore arp any any
Adding a comment to an existing MAC class entry:
switch(config)# class mac MY_MAC_CLASS switch(config-class-mac)# 10 comment MY_CLASS_ENTRY switch(config-class-mac)# exit switch(config)# do show class Type Name Sequence Comment Action EtherType Source MAC Address Destination MAC Address Additional Parameters ------------------------------------------------------------------------------- MAC MY_MAC_CLASS 10 MY_CLASS_ENTRY match lldp any any 20 ignore arp any any
Removing a comment from an existing MAC class entry:
switch(config)# class mac MY_MAC_CLASS switch(config-class-mac)# no 10 comment MY_CLASS_ENTRY switch(config-class-mac)# exit switch(config)# do show class Type Name Sequence Comment Action EtherType Source MAC Address Destination MAC Address Additional Parameters ------------------------------------------------------------------------------- MAC MY_MAC_CLASS 10 match lldp any any 20 ignore arp any any
Replacing a MAC class entry in an existing MAC class:
switch(config)# class mac MY_MAC_CLASS switch(config-class-mac)# 10 match any any any switch(config-class-mac)# exit switch(config)# do show class Type Name Sequence Comment Action EtherType Source MAC Address Destination MAC Address Additional Parameters ------------------------------------------------------------------------------- MAC MY_MAC_CLASS 10 match any any any 20 ignore arp any any
Removing a MAC class entry:
switch(config)# class mac MY_MAC_CLASS switch(config-class-mac)# no 1 switch(config-class-mac)# exit switch(config)# do show class Type Name Sequence Comment Action EtherType Source MAC Address Destination MAC Address Additional Parameters ------------------------------------------------------------------------------- MAC MY_MAC_CLASS 2 ignore arp any any
Removing a MAC class. Removing a class with entries removes all its entries as well. If a class associated with a policy entry (or multiple policy entries) is removed, the corresponding entries are also removed.
switch(config)# no class mac MY_MAC_CLASS switch(config)# do show class Type Name Sequence Comment Action EtherType Source MAC Address Destination MAC Address Additional Parameters ------------------------------------------------------------------------------- MAC MY_MAC_CLASS2 2 ignore arp any any