Wednesday, January 19, 2011

Limit Internet Bandwidth Usage (internet speed) in Ubuntu

There are many reasons one would want to limit internet bandwidth/speed on a system e.g you dont want your siblings to choke your internet or, if you are a network admin, you dont want one user, downloading a big movie over torrent, to hurt every one else's surfing.

To limit internet bandwidth on a Ubuntu machine install wondershaper. For this open a terminal and type following command:
sudo apt-get install wondershaper
Now use ifconfig command to find out the name of interface connected to internet. The name will be something like eth0, eth1, wlan0 or something similar. In my case it is eth0


Now issue a command similar to follwoing (relpacing eth0 with your interface name):
sudo wondershaper eth0 1024 256
this will limit the download speed to 1024 Kbps and upload to 256 Kbps. Remember that this limit is for all internet traffic i.e torrent, ftp, browsing and any thing else.

If you want to remove these limits use
sudo wondershaper clear eth0
again replacing eth0 with your interface name

1 comment:

Unknown said...

Aslaam o alaikum bhai g how can we block torrent on network.
internet is shared from my pc.
And second thin, i am using kubuntu 11.04 and using ptcl evo, it installs the device make the connectin but don't connect it.
Please guide me about that why the device is not connected.