Tuesday, April 07, 2009

Easy bandwidth shaping in Linux

There is an extensive and nicely written HOWTO on this topic but here I'm talking about some really easy to use bandwidth shaping tools -- wondershaper and trickle.

This is the easiest tool I have found to limit bandwidth of a particular interface. All it takes is,

$ sudo wondershaper {interface} {down} {up}
the {down} and {up} are bandwidth in kilobits. So for example if you want to limit the bandwidth of interface eth1 to 256kbps uplink and 128kbps downlink,

$ sudo wondershaper eth1 256 128
To clear the limit,

$ sudo wondershaper clear eth1
Easy, eh?

Unlike wondershaper, which limits the bandwidth to an entire interface, trickle is user-space bandwidth limiting tool. The syntax is,

$ trickle -u {up} -d {down} {program}
Both {up} and {down} and bandwidth in KB/s. Now if you invoke it as,

$ trickle -u 8 -d 8 firefox
It will fire up Firefox, limiting the bandwidth to 8KB/s. This is very useful specially if you are a web developer and want to test your application under various bandwidth conditions.

Furthermore, you can also run trickle as daemon (trickled) which can limit the bandwidth to several programs.


  1. Short Sweet and Daami Article,

    Malai chahi man paryo.

    I would have implemented, but Ghataune po parecha, badhaune bhayeko bhaye ta sure.

  2. i have an issue regarding this..
    when i download stuffs from p2p such as transmission bittorent, most of the bandwidht is consumed resulting in slow it possible to seperate bandwidth to p2p and browsing, such that i would not experience slow browsing when downloading...or something like that??

  3. you can limit b/w specific to ports using hbq or cbq. see this:

  4. nice stuff yaar ! काम लाग्ने चिज हो यो !

  5. you have a nice site. thanks for sharing this enormous resources. keep it up. anyway, various kinds of ebooks are available here

  6. Thanks for the info..was a gr8 help

  7. This is a very informative article.I was looking for these things and here I found it. this information is very useful me.
    Slim 24 Pro | Fair look | Zero Addiction | Air sofa | Air Bra | Step Up Height Increaser


  8. 5 in 1 Air Sofa Cum Bed at Best Offer Price :
    Purchase Online Air sofa bed amazingly comfortable lounger,recliner, amazingly
    convenient sofa and fold out high bed, queen size bed all in one. Order now air sofa 5 in 1 online.


  9. step up height increaser It’s an
    amazing ayurvedic product that not just increase your height up to 5 inch but also boost your strength,
    bone mass density. Step up body growth formula is a healthy product that also boost your immune and digestive
    system and provide you with healthy complete body growth.

  10. thanks for sharing this, trickle is better solution on CentOS though :)
    Vidmate App