match cos
To match a packet on the basis of a Layer 2 class of service (CoS)/Inter-Switch Link (ISL) marking, use the matchcos command in class-map configuration or policy inline configuration mode. To remove a specific Layer 2 CoS/ISL marking as a match criterion, use the no form of this command.
match cos cos-value [cos-value [cos-value [cos-value]]]
no match cos cos-value [cos-value [cos-value [cos-value]]]
Syntax Description
Supported Platforms Other Than the Cisco 10000 Series Routers |
|
---|---|
cos-value |
Specific IEEE 802.1Q/ISL CoS value. The cos-value is from 0 to 7; up to four CoS values, separated by a space, can be specified in one matchcos statement. |
Cisco 10000 Series Routers |
|
cos-value |
Specific packet CoS bit value. Specifies that the packet CoS bit value must match the specified CoS value. The cos-value is from 0 to 7; up to four CoS values, separated by a space, can be specified in one matchcos statement. |
Command Default
Packets are not matched on the basis of a Layer 2 CoS/ISL marking.
Command Modes
Class-map configuration (config-cmap)
Policy inline configuration (config-if-spolicy-inline)
Command History
Release |
Modification |
---|---|
12.1(5)T |
This command was introduced. |
12.0(25)S |
This command was integrated into Cisco IOS Release 12.0(25)S. |
12.2(28)SB |
This command was integrated into Cisco IOS Release 12.2(28)SB. |
12.2(33)SRA |
This command was integrated into Cisco IOS Release 12.2(33)SRA. |
12.2(31)SB |
This command was integrated into Cisco IOS Release 12.2(31)SB and implemented on the Cisco 10000 series routers. |
12.2SX |
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware. |
12.2(33)SRC |
This command was integrated into Cisco IOS Release 12.2(33)SRC and support for the Cisco 7600 series routers was added. |
12.4(15)T2 |
This command was integrated into Cisco IOS Release 12.4(15)T2. |
12.2(33)SB |
This command was integrated into Cisco IOS Release 12.2(33)SB and support for the Cisco 7300 series router was added. |
15.1(3)T |
This command was integrated into Cisco IOS Release 15.1(3)T for Cisco Performance Monitor. Support was added for policy inline configuration mode. |
12.2(58)SE |
This command was integrated into Cisco IOS Release 12.2(58)SE for Cisco Performance Monitor. |
12.2(33)SCF |
This command was integrated into Cisco IOS Release 12.2(33)SCF. |
3.2SE |
This command was integrated into Cisco IOS XE Release 3.2SE. |
15.1(2)SNG |
This command was integrated into Cisco ASR 901 Series Aggregation Services Routers. |
Usage Guidelines
This command can be used with both Flexible NetFlow and Performance Monitor. These products use different commands to enter the configuration mode in which you issue this command.
Cisco Performance Monitor in Cisco IOS Release 15.1(3)T and 12.2(58)SE
You must first enter the service-policytypeperformance-monitorinline command.
Examples
In the following example, the CoS values of 1, 2, and 3 are successful match criteria for the interface that contains the classification policy named cos:
Router(config)# class-map cos
Router(config-cmap)# match cos 1 2 3
In the following example, classes named voice and video-n-data are created to classify traffic based on the CoS values. QoS treatment is then given to the appropriate packets in the CoS-based-treatment policy map (in this case, the QoS treatment is priority 64 and bandwidth 512). The service policy configured in this example is attached to all packets leaving Fast Ethernet interface 0/0.1. The service policy can be attached to any interface that supports service policies.
Router(config)# class-map voice
Router(config-cmap)# match cos 7
Router(config)# class-map video-n-data
Router(config-cmap)# match cos 5
Router(config)# policy-map cos-based-treatment
Router(config-pmap)# class voice
Router(config-pmap-c)# priority 64
Router(config-pmap-c)# exit
Router(config-pmap)# class video-n-data
Router(config-pmap-c)# bandwidth 512
Router(config-pmap-c)# exit
Router(config-pmap)# exit
Router(config)# interface fastethernet0/0.1
Router(config-if)# service-policy output cos-based-treatment
Examples
The following example shows how to use the policy inline configuration mode to configure a service policy for Performance Monitor. The policy specifies that packets traversing Ethernet interface 0/0 that match the criteria of a CoS value of 2 will be monitored based on the parameters specified in the flow monitor configuration namedfm-2 :
Router(config)# interface ethernet 0/0
Router(config-if)# service-policy type performance-monitor inline input
Router(config-if-spolicy-inline)# match cos 2
Router(config-if-spolicy-inline)# flow monitor fm-2
Router(config-if-spolicy-inline)# exit
Examples
The following example shows how to match traffic classes for the 802.1p domain with packet CoS values:
Router> enable
Router# config terminal
Router(config)# class-map cos7
Router(config-cmap)# match cos 2
Router(config-cmap)# exit