class mac
Syntax
class mac [ ] {match|ignore} {any| [/ }]} {any| [/ }]} {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 ] [vlan< vlan id >] [count] [ ] comment
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.
Thenoform of the command can be used to delete either a MAC traffic class (usenowith the class command) or an individual MAC traffic class entry (usenowith the sequence number).
Command context
config
Theclass mac command takes you into theconfig-class-maccontext where you enter the class entries.
Parameters
-
mac -
Specifies create or modify a MAC class.
-
-
Specifies the name of this class.
-
-
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|[/ }]} -
Specifies the source host MAC address (xxxx.xxxx.xxxx), OUI, or the keyword
any. You can optionally include the following:- The address bits to mask (xxxx.xxxx.xxxx).
-
{any|[/ }]} -
Specifies the destination host MAC address (xxxx.xxxx.xxxx), OUI, or the keyword
any. You can optionally include the following:- The address bits to mask (xxxx.xxxx.xxxx).
-
Protocol -
Select an ethertype protocol from the following (enter one only):
any- Any ethertype protocol< NUMERIC-ETHERTYPE >- Enter an EtherType protocol number. Range: 0x600-0xffff.Or enter an EtherType protocol name from the following list:
aarpappletalkarpfcoefcoe-initipipv6ipx-arpaipx-non-arpais-islldpmpls-multicastmpls-unicastq-in-qrbridgetrillwake-on-lan
-
pcp -
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.
NOTE:This parameter cannot be used in any class that will be applied to a VLAN.
-
count -
Keeps the hit counts of the number of packets matching this class entry.
Authority
Administrators or local user group members with execution rights for this command.
Examples
Creating a MAC class:
switch(config)#class mac MY_MAC_CLASSswitch(config-class-mac)#match any any lldpswitch(config-class-mac)#ignore any any arpswitch(config-class-mac)#exitswitch(config)#do show classType 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
添加一个评论an existing MAC class entry:
switch(config)#class mac MY_MAC_CLASSswitch(config-class-mac)#10 comment MY_CLASS_ENTRYswitch(config-class-mac)#exitswitch(config)#do show classType 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_CLASSswitch(config-class-mac)#no 10 comment MY_CLASS_ENTRYswitch(config-class-mac)#exitswitch(config)#do show classType 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_CLASSswitch(config-class-mac)#10 match any any anyswitch(config-class-mac)#exitswitch(config)#do show classType 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_CLASSswitch(config-class-mac)#no 1switch(config-class-mac)#exitswitch(config)#do show classType Name Sequence Comment Action EtherType Source MAC Address Destination MAC Address Additional Parameters ------------------------------------------------------------------------------- MAC MY_MAC_CLASS 2 ignore arp any any
The corresponding entries are only removed if the class is unused by all policy entries.
switch(config)#no class mac MY_MAC_CLASSswitch(config)#do show classNo Class found.