To define the match
criteria to classify traffic, use the
match command
in class-map configuration mode. Use the
no form of this
command to remove the match criteria.
match { access-group { name acl-name
| acl-index } | class-map
class-map-name | cos cos-value | dscp dscp-value | [ ip
] dscp dscp-list
| [ip] precedence ip-precedence-list | precedence precedence-value1...value4 | qos-group qos-group-value | vlan vlan-id }
no match { access-group { name acl-name
| acl-index } | class-map
class-map-name | cos cos-value | dscp dscp-value | [ ip
] dscp dscp-list
| [ip] precedence ip-precedence-list | precedence precedence-value1...value4 | qos-group qos-group-value | vlan vlan-id }
Syntax Description
access-group
|
Specifies
an access group.
|
name
acl-name
|
Specifies
the name of an IP standard or extended access control list (ACL) or MAC ACL.
|
acl-index
|
Specifies
the number of an IP standard or extended access control list (ACL) or MAC ACL.
For an IP standard ACL, the ACL index range is 1 to 99 and 1300 to 1999. For an
IP extended ACL, the ACL index range is 100 to 199 and 2000 to 2699.
|
class-map
class-map-name
|
Uses a
traffic class as a classification policy and specifies a traffic class name to
use as the match criterion.
|
cos cos-value
|
Matches a
packet on the basis of a Layer 2 class of service (CoS)/Inter-Switch Link (ISL)
marking. The cos-value is from 0 to 7. You can specify up to four CoS values in
one
match cos
statement, separated by a space.
|
dscp dscp-value
|
Specifies
the parameters for each DSCP value. You can specify a value in the range 0 to
63 specifying the differentiated services code point value.
|
ip dscp
dscp-list
|
Specifies
a list of up to eight IP Differentiated Services Code Point (DSCP) values to
match against incoming packets. Separate each value with a space. The range is
0 to 63. You also can enter a mnemonic name for a commonly used value.
|
ip precedence
ip-precedence-list
|
Specifies
a list of up to eight IP-precedence values to match against incoming packets.
Separate each value with a space. The range is 0 to 7. You also can enter a
mnemonic name for a commonly used value.
|
precedence precedence-value1...value4
|
Assigns an
IP precedence value to the classified traffic. The range is 0 to 7. You also
can enter a mnemonic name for a commonly used value.
|
qos-group qos-group-value
|
Identifies
a specific QoS group value as a match criterion. The range is 0 to 31.
|
vlan vlan-id
|
Identifies
a specific VLAN as a match criterion. The range is 1 to 4095.
|
Command Default
No match criteria
are defined.
Command Modes
Class-map configuration
Command History
Cisco IOS XE 3.2SE
|
This command was introduced.
|
Cisco IOS XE 3.3SE
|
The
class-map
class-map-name ,
cos cos-value ,
qos-group qos-group-value , and
vlan vlan-id keywords were added.
|
Usage Guidelines
The
match command
is used to specify which fields in the incoming packets are examined to
classify the packets. Only the IP access group or the MAC access group matching
to the Ether Type/Len are supported.
If you enter the
class-map
match-any class-map-name
global configuration command, you can enter the
following
match
commands:
The
match access-group
acl-index command is not supported.
To define packet
classification on a physical-port basis, only one
match command
per class map is supported. In this situation, the
match-any
keyword is equivalent.
For the
match ip dscp
dscp-list or the
match ip precedence
ip-precedence-list command, you can enter a
mnemonic name for a commonly used value. For example, you can enter the
match ip dscp
af11 command, which is the same as entering the
match ip dscp
10 command. You can enter the
match ip
precedence
critical command, which is the same as entering the
match ip precedence
5 command. For a list of supported mnemonics, enter the
match ip dscp
? or the
match ip precedence
? command to see the command-line help strings.
Use the
input-interface
interface-id-list keyword when you are configuring
an interface-level class map in a hierarchical policy map. For the
interface-id-list , you can specify up to six
entries.
Examples
This example shows
how to create a class map called class2, which matches all the incoming traffic
with DSCP values of 10, 11, and 12:
Switch(config)# class-map class2
Switch(config-cmap)# match ip dscp 10 11 12
Switch(config-cmap)# exit
This example shows
how to create a class map called class3, which matches all the incoming traffic
with IP-precedence values of 5, 6, and 7:
Switch(config)# class-map class3
Switch(config-cmap)# match ip precedence 5 6 7
Switch(config-cmap)# exit
This example shows
how to delete the IP-precedence match criteria and to classify traffic using
acl1:
Switch(config)# class-map class2
Switch(config-cmap)# match ip precedence 5 6 7
Switch(config-cmap)# no match ip precedence
Switch(config-cmap)# match access-group acl1
Switch(config-cmap)# exit
This example shows
how to specify a list of physical ports to which an interface-level class map
in a hierarchical policy map applies:
Switch(config)# class-map match-any class4
Switch(config-cmap)# match cos 4
Switch(config-cmap)# exit
This example shows
how to specify a range of physical ports to which an interface-level class map
in a hierarchical policy map applies:
Switch(config)# class-map match-any class4
Switch(config-cmap)# match cos 4
Switch(config-cmap)# exit
You can verify
your settings by entering the
show
class-map privileged EXEC command.