[H-GEN]

Tony Nugent tony at linuxworks.com.au
Sat May 10 05:46:41 EDT 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

On Sat May 10 2003 at 10:37, "Three Blokes" wrote:

>   I have a Gateway running SME Server, which is just a heavily modified
> Redhat Distribution(From memory I think it's 7.3).  Is there a way, using
> NAT or the dhcp(or any program really) to limit bandwidth to certain
> computers?  We have twenty computers here that all use the same 'net pipe,
> which is no problem until one person downloads, then you hear all the gamers
> scream when their ping hits the roof!
> 
> If this is possible then any links to some reading material would be
> appreciated.

Traffic control is already there as an integral part of the kernel's
networking capabilities (since 2.2.x).  The tool to access it is
/sbin/tc (for "traffic control").

  It's big brother utility is /sbin/ip, which is a powerful utility
  that gives you raw access to the full power of the kernel's
  networking capabilities (apart from netfilter).  /sbin/ip
  obseletes /sbin/route /sbin/ifconfig and /sbin/arp.  It comes with
  the iproute-2 package.

  One interesting aspect is "/sbin/ip rule", which allows you to do
  policy routing (including multiple routing tables, route nat,
  building firewalls with pure routing, routing decisions by source
  ip rather than destination ip (and port, if you use iptables to
  fwmarks packets in the mangle PREROUTING chain), and many other
  very cool things.

I'll get off the soapbox and let you loose on the following links...

CBQ-based Traffic Control GUI
	http://users.skynet.be/am032016/
Linux Advanced Routing & Traffic Control
	http://lartc.org/
Linux Advanced Routing & Traffic Control HOWTO
	http://lartc.org/howto/
iproute2+tc notes
	http://snafu.freedom.org/linux2.2/iproute-notes.html

The traffic shaper module might also be useful:

The Linux traffic shaper
	http://lwn.net/1998/1119/shaper.html

There are circumstances where /sbin/ip can be used to do traffic
balancing with pure routing, but it is more crude... for example,
you can specify load balancing ("weight") if multiple routes are
used ("nexthop") to specify a route (see "/sbin/ip route help").

Have fun!

> Thanks,
>    Joe

(btw, who are the other two blokes? :)

BTW, I've been doing this with redhat 7.3 ever since it was
released, the default kernels have always worked (in fact, ever
since rh7.0... only the more recent rh6.2 kernels were built
correctly with all these features turned on by default).

I have found that the main problem with all this is keeping state
through reboots after you configure it and have it working nicely.
I've written some an init script (probably going a bit rusty and
needs a touch-up) that saves (and deletes) the current routing and
ip policy state (like "service iptables save"), and reloads it at
bootup.  If you find that you end up needing something like this,
let me know (privately).  Sorry, no utilities for /sbin/tc, but you
are likely to have some luck if you google at
http://google.com/linux -- someone has surely done this before.

Cheers
Tony

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list