*** IMPORTANT NOTE ***
======================
  If you do NAT with your iptables, DO NOT use MASQUERADE rule. Instead of it,
use -j SNAT --to-source <MACHINE's IP>. Same chain from masquerade. 
  Ah! Take a look also if you use the -o <iface> option. That should be either
changed to the corresponding shaper interface (usually even -- if you start 
from a odd shaper number).
  You may ask me for my firewall script which will use some ways to detect which
way to filter and do it.

How to install
-============-

Copy shapecfg (there are linux binaries either for i386 linux libc6 and uClibc,
  this binary is just to hurry up things for linux users) to your path, usually
  /usr/sbin.
 *** NOTE ***
As I can't find the original site for the maintaner of the shapecfg package, I
  am putting it all together with my pack, but the shaper app is under some 
  license. If the author come to see this package carrying his code (of
  shapecfg), please contact me so I can instead provide a site with the original
  latest update package container, and/or provide the specific license with
  this package and name it shapecfg's license.
 *** NOTE END ***

Copy rc.shape and shape.conf (by default) to /root/shaper.
  If you want to change this, e.g. keep rc.shape on /etc/rc.d/rc.shape and
  shaper.conf at /etc/shaper.conf, you should edit the 'maindir' var on rc.shape
  to /etc; and maindir on shaper.conf to /etc/rc.d (one need to find the other).

Edit shaper.conf to fit your needs. Note that the patch is not (as the launch of
  this script) publicly available, so the 'patched' var must be set to 'no'.
  Although support for more than 100 shapers is working, its being tested on 
  kernel 2.4.26 and will soon be within this package or near to it @ sf.net.
  It is very important to review the self explained examples into the {} of the
  conf file (that is mostly a part of a bash script)
As from 1.10, there's also instructions on how to patch manually your kernel 
  without having to build your kernel. Also, this version uses shapN-M instead
  of the old shaperN-M name.

Put that script to be ran at boot time. You may also use cron to stop it e.g at
  night and come up at 8 am.

Manually Patching your kernel
-===========================-
   The patch made for the older versions is now obsolete, as the package uses
other interface name, this was done in order to allow to 'manually' patch your
shaper.o module to work for more than 100 interfaces.
   Unfortunately, although you can make unlimited number of interfaces (limited
only by the amount of memory and disk space), the kernel routing tables are li-
mited to only 256, and some of these are already defined for something. 0 is the
default shown by 'route' command, and I think 254 and 255 are used for other
purpose.
   The number of interfaces will not harm much the system, as you need just only
the shaper module file (which will use around 16k), for each set of 100 shapers.
Each of that changed according to this patch.
   To actually apply the patch, without recompiling the kernel, you may use the
'vi' editor or any hexa-editor to change the shaper.o module. You will have to
do:
- Copy shaper.o to shap0-0.o, shap1-0.o, shap2-0.o and so on.
- Edit each file, looking for a "shaper%d" string (vim: '/shaper%d' command)
 into the file, and changing it according to the filename to shap0-%d, shap1-%d,
 shap2-%d, and so on.
- Perhaps you will need to do a 'depmod -a' to make modutils find the modules,
 but the script manually looks for them, using insmod, into the directory
 /lib/modules/`uname -r`/kernel/drivers/net, avoiding the need of the depmod 
 command.

   It will be enough to make until shap4-0 (up to 500 shapers), and you will be
still able to user the shaper.o module with no conflicting w/ the other modules.

Info
-==-

   This script is intended for ISPs to control bandwidth e.g. for radio links,
as long as disposed is a linux box to route traffic there.
   The principal advantage of this script is to afford the real bandwidth (in
bits per second) to the end-user. The shaper script is well known for its hea-
viness. Nothing gets over it's limit. Not even multiple millions of connections
can bypass its limitation (which occurs with some CBQ issues on well-known
qdiscs).
   The disadvantage over cbq is that it is only route-based, and cannot be chan-
nelled throught specified ports/services.

Tips/Considerations
-=================-
   This script is incompatible with 'spoof protection' from the kernel. You may
disable it by echoing 0 to /proc/sys/net/ipv4/conf/all/rp_filter. This was very
common amongst LEAF lrp packages.
   It was always, but now we explicitly are saying: You -need- iproute2 package
in order to use this script. Also, you need a bash-like shell to use it.
   Consider adding support to this when compiling your kernel: 'IP: Advanced Router'. Without this you will be also unable to set the routes for the outgoing
traffic to be shaped.

Contact and author info
-=====================-

   You may thank, give tips, send bugs and patches to me via e-mail

Fabricio Murta<avenger@buynet.com.br>

   I would be glad to answer (and read) your comments and experiences.

