VLAN Based Traffic Shaping Cisco Switch - GPON Solution

VLAN Based Traffic Shaping Cisco Switch

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.

You can enable bandwidth shaping on an interface (or sub-interface) in three easy steps. Just remember: class, policy & interface.


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


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.

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


Finally, we need to apply the policy map to an interface using the service-policy configuration command. Here we apply it fa0/1 interface.

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:

VLAN based traffic shaping configuration

VLAN based traffic shaping configuration

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



Hi! I am Shahed. Currently working as a Network Engineer. I want to build up my carrier in Networking field.

Follow Me:
TwitterFacebookLinkedInPinterestGoogle PlusDiggYouTubeRedditDelicious

VLAN Based Traffic Shaping Cisco Switch was last modified: October 24th, 2015 by Shahed



2 Responses to VLAN Based Traffic Shaping Cisco Switch

  1. Mohammad says:

    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?


Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

error: Content is protected !!