jeudi 8 mai 2014

Easy network traffic shaping on your ubuntu system (debian/Ubuntu)

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 /sbin/wondershaper <interface name> <downspeed> <upspeed> down /sbin/wondershaper clear <interface name>

Thats it, From now on all sensitive traffic like your voip, HTTP, SSH will get prioritied 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.