Skip to content


Linux: how to limit bandwitdh usage

I found mainly 2 tools (source), Wondershaper and Trickle. Wondershaper only lets you limit the traffic globally, while Trickle allows you to limit it application by application. But the problem with Trickle is that it requires you to modify the way you launch programs, ie, for a program to be limited by Trickle, you need to launch it through Trickle, such as:
trickle -d 500 -u 50 wget http://www.example.com/somefile
Not too convenient, so I only used Wondershaper, even though a global limitation wasn’t exactly what I wanted at first.

To install it (Ubuntu): apt-get install wondershaper
Then, find the name of your network interface. If it’s Ethernet, it will likely be eth0 or eth1. To be sure, just run ifconfig and spot the interface which has your external (not 127.0.0.1) IP address.

Then you can apply bandwidth restriction to this interface, by using a command like:
wondershaper eth1 [down speed] [up speed]
(note that speeds are in kbps – kilobits per second, 10 kilobits per second = about 1.1 kilobytes per second)

So for instance, if I want to limit my eth1 interface to 20Mbps down / 5Mbps up, I’ll use:
wondershaper eth1 20000 5000

Finally, if you want to remove those limits, use:
wondershaper clear eth1

Posted in Linux, servers.


2 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Albirew says

    You wanted something like this? http://www.webupd8.org/2009/03/netlimiter-for-linux-pyshaper.html

    I’m overseas so I don’t really have time to check but author’s website seem down (foundable on archive.org’s wayback machine…

  2. patheticcockroach says

    Yeah, that looks great, but I’m not too found of discontinued software though. Still, the Linux equivalent of Netlimiter is just what I was looking for indeed.



Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA