Policy-maps do indeed have the ability to be nested inside other policy maps. When we engage in this nesting behavior, we refer to the policy as a hierarchical policy. This is typically done to configure multiple treatments to QoS. For example – we might want to traffic-shape all traffic to 3 MB; and then inside that 3 MB shaped traffic, guarantee Web traffic at least 1 MB of bandwidth.
Remember, we use a service-policy (normally done with interfaces) to assign the QoS policies that we define inside the policy-map.
With the nesting of policy maps, there are some restrictions that you should be aware of. For example:
setcommand is not supported on the child policy
prioritycommand can be used in either the parent or the child policy, but not both
fair-queuecommand cannot be used in the parent
Here is an example of nesting policy maps:
class-map CM_ALL_TRAFFIC match any ! class-map CM_WEB match protocol http ! policy-map PM_CHILD class CM_WEB bandwidth 1000 ! policy-map PM_PARENT class CM_ALL_TRAFFIC shape 3000000 service-policy PM_CHILD
Verifying your policy-map, is very simple thanks to the following show commands:
show policy-map show policy-map interface int_name