class-map
To define a traffic class and the associated rules that match packets to the class, use the class-map command in the global configuration mode. To remove an existing class map from the router, use the no form of this command.
class-map [type [traffic | qos]] [match-all] [match-any] class-map-name
no class-map [type [traffic | qos]] [match-all] [match-any] class-map-name
Syntax Description
type qos |
(Optional) Specifies a quality-of-service (QoS) class-map. |
traffic |
(Optional) Specifies traffic type class-map. |
match-all |
(Optional) Specifies a match on all of the match criteria. |
match-any |
(Optional) Specifies a match on any of the match criteria. This is the default. |
class-map-name |
Name of the class for the class map. The class name is used for the class map and to configure policy for the class in the policy map. The class name can be a maximum of 63 characters, must start with an alphanumeric character, and in addition to alphanumeric characters, can contain any of the following characters: . _ @ $ % + | # : ; - = |
Command Default
Type is QoS when not specified.
Command Modes
Global configuration
Command History
Release | Modification |
---|---|
Release 6.1.42 |
This command was introduced. |
Usage Guidelines
The class-map command specifies the name of the class for which you want to create or modify class map match criteria. Use of this command enables class map configuration mode in which you can enter any match command to configure the match criteria for this class. Packets arriving on the interface are checked against the match criteria configured for a class map to determine if the packet belongs to that class.
These commands can be used in a class map match criteria for the ingress direction:
-
match [not] dscp
-
match [not] mpls experimental topmost
-
match [not] precedence
-
match [not] protocol
Task ID
Task ID |
Operations |
---|---|
qos |
read, write |
Examples
These examples show how to specify class1 as the name of a class and defines a class map for this class.
RP/0/(config)# class-map class1
RP/0/(config-cmap)# match dscp ipv4 1
RP/0/(config)# class-map class1
RP/0/(config-cmap)# match precedence ipv4 1
RP/0/(config)# class-map class1
RP/0/(config-cmap)# match cos 1