Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a Linux-based router which is currently working fairly well, but our network only has a 1.5 mbps incoming connection. The network is small, but during high load periods some systems can end up dominating the bandwidth. For example, a client downloading a file can easily saturate the connection leaving everyone else with barely any access to the outside world.

Naturally, I'd like to fix this. I believe a combination of iptables rules and tc is in order, but I have no idea how to go about distributing the bandwidth evenly across the clients.

It would be nice if there was a way to divide the bandwidth only across clients that are actually utilising the connection as well, rather than hard limit each connection to (bandwidth / number of clients).

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

If it's web traffic, you're talking about, Squid can do this. It can restrict the max bandwidth for all users and the max bandwidth per user.

I implemented this solution to fix this exact problem.

If you ever want to use something else, do not use tc. It's a mess. Use OpenSolaris and flowadm which is muuuuch simpler.

share|improve this answer
    
We already run a Squid transparent proxy which all web traffic goes through. Ideally all traffic would be shaped, so non-web traffic also gets a chance. I could use OpenSolaris, but I don't have much experience with it and I would have to completely reconfigure the gateway machine. –  Matthew Iselin Apr 24 '10 at 23:46
add comment

Here is something that looks like the scripts I used once:
http://www.amiryan.org/2009/02/16/traffic-shaping-under-linux-with-tc-and-iptables/

HTH

share|improve this answer
add comment

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.