Easy network traffic shaping on your ubuntu system

Traffic shaping on Linux system used to require knowledge of lot of things like iptables, qdiscs & networking protocols. Things have changed and now there are couple of tools which handle all of this complexity without requiring much knowledge. And one of them is wondershaper.
First install wondershaper by issuing following command.
sudo apt-get -y install wondershaper
Use following command template to make it work right away.
sudo wondershaper <interface name> <down speed> <up speed>
Where interface name is your network interface name like eth0 or eth1 or wifi0 and down speed , up speed are self explanatory and specified in kilo bits per second.
So sample command will look like
sudo wondershaper eth0 512 512
To disable wondershaper from controlling particular interface use following command.
sudo wondershaper clear <interface name>
To make these changes permanent add following lines to /etc/network/interfaces under relevant interface section.
up /usr/sbin/wondershaper <interface name> <downspeed> <upspeed>
down /usr/sbin/wondershaper clear <interface name>
Thats it, From now on all sensitive traffic like your voip, HTTP, SSH will get prioritized while heavy traffic like bit torrent will not be prioritized. This is not a perfect tool for the job but simple enough to be used by newbies.

Edit: Corrected the paths as pointed out by the commenters. 


Neuron said...

I do not understand yet how this will prioritize one type of traffic over the other, as there might be different kinds of traffic within eth0, eth1, wifi0 etc... How does that work?

shadow said...

Even I am not sure how to deal with traffic over different interfaces. This is for newbies who just want to setup traffic shaping asap.

If you want to have advanced control over traffic shaping then you should go with iptables and qdiscs. As it allows more granular control over traffic shaping.

Anonymous said...

The way I understand it the guy who made it put all the optimizations the way he wanted so like still able to surf while torrents dl and stuff. So it is all configured and it worked VERY well for me without any real work. I used to use Cfosspeed on Win and I'd say this may work better but isn't as configurable as far as prioritizing per app but really nice and quick.

Anonymous said...

/sbin/wondershaper don't exist! please correct /usr/sbin......

Anonymous said...

/sbin/wondershaper does exist. Everyone should be using "which" to double check paths for executable anyways.