Search My Techie Guy

Monday, September 7, 2015

Bandwidth limiting a sub-interface on a cisco ios router

The configuration below will limit the uplink and downlink bandwidth of the specified interface on a cisco router:

Step 1: Create a policy map e.g "allowed_bw_3M" to limit uplink and downlink to 3Mbps

Router#configure t
Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#policy-map allowed_bw_3M
Router(config-pmap)#class class-default
Router(config-pmap-c)#police cir 3072000

Note: 3 x 1024 x 1000 = 3072000 (convert to bit rate or biTs per second)

Router(config-pmap-c-police)#conform-action transmit
Router(config-pmap-c-police)#exceed-action drop
Router(config-pmap-c-police)#end
#

Step 2: Apply the policy to the interface
#
Router#config t
Enter configuration commands, one per line.  End with CNTL/Z.

Router(config)#interface GigabitEthernet0/0.512
Router(config-subif)#service-policy input allowed_bw_3M
Router(config-subif)#service-policy output allowed_bw_3M
Router(config-subif)#do wr
Building configuration...
[OK]
Router(config-subif)#end
#

You can use speed test on a computer connected behind this interface to test the results of this configuration.

No comments: