27-40
Software Configuration Guide—Release 12.2(25)SG
OL-7659-03
Chapter27 Configuring Quality of Service
Configuring QoS
You can configure hierarchical policers with the service-policy policy-map config command. A policy
map is termed flow based if the class map it uses matches any of the flow-based match criteria
(such as match flow ip source-address). Each child policy map inherits all the match access-group
commands of the parent.
Note You can configure only flow based policy maps as child policy maps. A parent policy map cannot be a
flow-based policy map. Both the child policy map and parent policy map must have match-all in their
class-map configuration.
To configure a flow based policy map as a child of an individual or aggregate policer, perform this task:
This example shows how to create a hierarchical policy map. A policy map with the name
aggregate-policy has a class map with the name aggregate-class. A flow-based policy map with the name
flow-policy is attached to this policy map as a child policy map.
Switch# config terminal
Switch(config)# policy-map aggregate-policy
Switch(config-pmap)# class aggregate-class
Switch(config-pmap-c)# service-policy flow-policy
Switch(config-pmap-c)# end
Switch#
In the following example, traffic in the IP address range of 101.237.0.0 to 101.237.255.255 is policed to
50 Mbps. Flows ranging from 101.237.10.0 to 101.237.10.255 are individually p oliced to a rate of 2
Mbps. This traffic goes through two policers: the aggregate policer and the other flow-based policer.
The following example shows the configuration for this scenario:
class-map match-all flow-class
match flow ip source-address
match access-group 20
!
class-map match-all aggregate-class
match access-group 10
!
policy-map flow-policy
class flow-class
police 2000000 bps 10000 byte conform-action transmit exceed-action drop
!
policy-map aggregate-policy
class aggregate-class
police 50000000 bps 40000 byte conform-action transmit exceed-action drop
service-policy flow-policy
!
access-list 10 permit 101.237.0.0 0.0.255.255
access-list 20 permit 0.0.10.0 255.255.0.255
Command Purpose
Step1 Switch(config)# policy-map
policy_name
Specifies the individual or aggregate
policy-map name.
Step2 Switch(config-pmap)# class
class_name
Specifies the class-map name of this policy
map.
Step3 Switch(config-flow-cache)# service-policy
service_policy_name
Specifies the name of the flow-based policy
map.