I have a 64MB/s internet connection and it should be divided among 17 LANs with a priority. Any computer from any LAN should have a particular share from bandwidth (For example computers from LAN1 have half of bandwidth that computers from LAN2) but it's share should vary when overall internet load varies.

So the allocated bandwidth should not be given statically and must be changed according to the load.

I tried Squid and iproute. But as far as i found, none of them could allocate bandwidth dynamically. They just could give an IP a static bandwidth (say 64kbps)

As Crankyadmin, carson and David Bliss said, there are three ways to do this:

As i found, all of them are solutions for this problem. But i don't know if one is suitable for high loads and can manage hundreds of Computers.

I am using FreeBSD as a proxy server so it's nice to have a solution that works on FreeBSD too.

So I need a FreeBSD compatible solution that can deal with high load. it should be efficient and fast) and doesn't waste the internet bandwidth.


You should be able to do this using something like Shorewall. Check out the section on traffic shaping. Look at the "Using builtin traffic shaping/control" section and then RATE. You should be able to give each LAN a minimum and maximum rate then prioritize each. If the pipe is idle everyone will get what they want but as it fills up the higher priority LANs will push out the lower priority LANs.


A combination of the BSD pf packet filter and ALTQ should enable you to allocate dynamically network bandwidth. The OpenBSD documentation includes an example configuration for the following situation:

Reserve 80Kbps of download bandwidth for Bob so he can play his online games without being lagged by Alice or Charlie's downloads. Allow Bob to use more than 80Kbps when it's available.

On FreeBSD the pf packet filter is available as a loadable module, or can be compiled into the kernel. ALTQ is also available on FreeBSD, but only by being compiled into the kernel.

  • +1 for ALTQ (wich is in pfSense), extremely well-written software. It's tremendeous for asymmetrical connections with TCP ACK priority. – pauska Nov 14 '09 at 13:25

You may want to checkout pfSense

  • pfSense is used in some massive installs, I believe Fox Networks is run by a few of these with CARP for redundancy. Pfsense can be used as a VPN server and Proxy Server. (I believe shorewall also does the same.) Better yet it is FreeBSD! – Crankyadmin Nov 14 '09 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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