Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm kind of new to Linux (but learning) so bare with me if I say something stupid :P.

I'm currently running an Ubuntu fileserver which automates a whole bunch of downloading tasks. At present it is set to throttle downloads at certain times so I don't impact too much on casual browsing iPlayer etc during peak times. But this is not ideal.

I was wondering if it is possible to limit overall system bandwidth usage based on sniffing packets from other systems on the LAN that are going to/from specific URLS (e.g. iplayer)

If somebody could point me in the direction of the relevant tools, I'm happy to do the research myself. Just right now I wouldn't know where to start...

share|improve this question

1 Answer 1

There are a couple of approaches that come to mind.

Method #1 - iptables

Yes it is possible through iptables to throttle traffic based on either the TCP port(s) it's making use of or the source IP addresses that it's originating from. I would need to know specifics in order to assist in crafting actual rules for your situation.

Method #2 - traffic shaping QoS

The other approach is to throttle specific applications using tools such as Wondershaper or Trickle.

Examples

To throttle the upload/download speed to 20Kbps.

$ trickle -d 20 wget -c http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm

You can also set these independently in the above scenario. You can also make these settings the default like so.

$ trickled -d 50 -u 10

You can also use Wondershaper to control the bandwidth at the network level. For example say I want to throttle my eth1 device.

$ sudo wondershaper eth1 1024 256

This will give me a Download speed of 1024 Kbits and 256 Kbits Upload. Which are 128KB and 16KB.

When you want to release the caps.

$ sudo wondershaper clear eth1

These are pretty capable tools so this is just meant to show you the potential.

References

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.