VLAN Based Traffic Shaping:
Today i will discuss how to configure VLAN based traffic shaping on cisco Catalyst ME3400 switch. Suppose you have 4 vlan [21,22,23,24] on a trunk port & you want to bandwidth shaping specific vlan 21 & 22. Here we declare 5Mbps BW for Vlan 21 & 2Mbps BW for Vlan 22. [boxads]
You can enable bandwidth shaping on an interface (or sub-interface) in three easy steps. Just remember: class, policy & interface.
Class:
At first you need to create a class map for those Vlan. Here we create vlan21 & vlan22 as a class map.
class-map match-all vlan21  match vlan 21 class-map match-all vlan22  match vlan 22
policy:
Now it’s time to define our policy map. In this case, we’re going to take any traffic that matched the vlan21 & vlan22
class (which, as you remember, is all traffic) and apply a shaping policy to it. Also we create subvlan & mainvlan policy map.
[adsense]
Here we create subvlan for traffic shaping & create mainvlan for aggregate two subvlan in a policy map.
Configuration example of subvlan:
 policy-map subvlan21    class class-default     police cir 5242880 bc 1000000       conform-action transmit       exceed-action drop
 policy-map subvlan22    class class-default     police cir 2097152 bc 1000000       conform-action transmit       exceed-action drop
Configuration example of mainvlan:
policy-map mainvlan class vlan21 service-policy subvlan21 class vlan22 service-policy subvlan22
Interface:
Finally, we need to apply the policy map to an interface using the service-policy
configuration command. Here we apply it fa0/1 interface.
[bodyads]
Configuration example of applying mainvlan in an interface:
interface FastEthernet0/1  description "your description here"  port-type nni  switchport trunk allowed vlan 21,22,23,24  switchport mode trunk  duplex full  storm-control broadcast level 5.00  no cdp enable  no cdp tlv server-location  no cdp tlv app  spanning-tree bpdufilter enable  service-policy input mainvlan
Look like bellow format in Switch:
Command for remove all created policy-map:
SW1(config)#no policy-map subvlan21
SW1(config)#no policy-map subvlan22
SW1(config)#no policy-map mainvlan
SW1(config)#no class-map vlan21Â Â
SW1(config)#no class-map vlan22
Thanks for the great post
I think this configuration will work only for the input traffic , as the match vlan will not work for the output policy right?
How can I do that for output traffic?
Thanks
Yes it is work only input traffic.Thanks for nice comments,