class (policy-map)
To specify the name of the class whose policy you want to create or change, use the class command in policy map configuration mode. To remove a class from the policy map, use the no form of this command.
class [type qos] {class-name | class-default}
no class [type qos] {class-name | class-default}
Syntax Description
type qos |
(Optional) Specifies a quality-of-service (QoS) class. |
class-name |
Name of the class for which you want to configure or modify policy. |
class-default |
Configures the default class. |
Command Default
No class is specified.
Type is QoS when not specified.
Command Modes
Policy map configuration
Command History
Release |
Modification |
---|---|
Release 6.0 |
This command was introduced. |
Usage Guidelines
Within a policy map, the class (policy-map) command can be used to specify the name of the class whose policy you want to create or change. The policy map must be identified first.
To identify the policy map (and enter the required policy map configuration mode), use the policy-map command before you use the class (policy-map) command. After you specify a policy map, you can configure the policy for new classes or modify the policy for any existing classes in that policy map.
The class name that you specify in the policy map ties the characteristics for that class—that is, its policy—to the class map and its match criteria, as configured using the class-map command.
The Single-Rate Two-Color (SR2C) in color-blind mode for confirm and exceed actions are supported in ingress direction.
Note |
It is mandatory to configure all the 8 qos-group classes (including class-default) for the egress policies in the Cisco NCS 5000 Series Routers. |
RP/0/RP0/CPU0:router(config)# policy-map pm1
RP/0/RP0/CPU0:router(config-pmap)# end-policy-map
RP/0/RP0/CPU0:router(config)# end
!
RP/0/RP0/CPU0:router# show running-config
!
policy-map pm1
class class-default
!
end-policy-map
!
Task ID
Task ID |
Operations |
---|---|
qos |
read, write |
Examples
RP/0/RP0/CPU0:router(config)# class-map class1
RP/0/RP0/CPU0:router(config-cmap)# match precedence 3
RP/0/RP0/CPU0:router(config-cmap)# exit
RP/0/RP0/CPU0:router(config)# policy-map policy-in
RP/0/RP0/CPU0:router(config-pmap)# class class1...
RP/0/RP0/CPU0:routerconfig-pmap-c)# police rate percent 30
RP/0/RP0/CPU0:router(config-pmap-c-police)# exit
RP/0/RP0/CPU0:router(config-pmap-c)# exit
RP/0/RP0/CPU0:router(config-pmap)# class class-default
RP/0/RP0/CPU0:router(config-pmap-c)# police rate percent 20
The default class is used for packets that do not satisfy configured match criteria for class1. Class1 must be defined before it can be used in policy1, but the default class can be directly used in a policy map, as the system defines it implicitly.