Applying A QoS Policy on A Subinterface
When you try to apply a Cisco QoS policy on a subinterface, you may get the following error message
CBWFQ : Not supported on subinterfaces
In this case, we need to use the concept of hierarchical policy, or parent and child policies. The parent policy is like a container. The child policy is the one that you wanted to apply in the first place. So for example if you want to apply a policy named “WAN_Policy”, this will be your child policy that will go under the parent policy.
In practice, what we need to do is:
- create a parent policy. Let’s name it Shaping,
- call the default class under the parent policy and configure traffic shaping for it. Recall that the default class is named class-default. Traffic shaping needs to be configured with an adequate CIR. CIR depends on the contracted bandwidth. In my case, I want to apply the QoS policy on a GigaEthernet interface connected to the WAN, and with a CIR of 20Mbps.
- this is the tricky part: attach the child policy WAN_Policy to the parent policy Shaping.
Here is what the configuration will look like.
Average Rate Traffic Shaping
cir 20000000 (bps)
(here goes the class definition of the policy. It depends what you’ve set on your device)
The last thing is to apply the parent policy to the subinterface:
service-policy output Shaping
You should replace Gi0/0.1122 with your interface number