
CTShaper is a shell-script that helps setting up a traffic shaper, using Linux's built-in network QoS (Quality of Service) infrastructure.
Have you ever noticed how your SSH/gaming sessions become sluggish when you start downloading something, or how your
downloads slow down when you start uploading?
Have you ever been annoyed by other peoples' downloads forcing you to wait ages while an email is being sent?
Or making your web navigation painfully slow?
Well, if your outgoing link is managed by a Linux router/gateway, then you could benefit from using CTShaper.
CTShaper reduces link latency by preventing packet queues from getting too long on your side (your ADSL or Cable
modem) and on your ISP's side (their routers). Long packet queues is what makes your uploads interfere with your
downloads, and your downloads interfere with your SSH or gaming sessions.
Additionally, CTShaper sets up four traffic queues with different priorities and configurable flow rates
(to have minimum bandwidth guarantees for each class).
By default, only traffic with ToS (Type of Service) information gets prioritized (which could be enough, if lots of
software had support for it, which they don't), but you can use your firewall (iptables, or an iptables frontend like
FireHOL) to "mark" traffic. The traffic shaper will then prioritize
(outgoing) traffic based on those "marks".
You can, for instance, give priority to SMTP and HTTP traffic. This will only affect outgoing HTTP and SMTP
traffic, but that's enough to make your emails go out faster, and your web navigation more responsive.
tc (part of the iproute2 package).Fortunately, most recent distributions already fit the required profile.
./install.sh;/etc/ctshaper/ctshaper.conf (instructions are contained in the configuration file itself);extras/iptables-mark.sh script as-is, copy/paste
the rules defined in it to your custom firewall scripts, or, if you are using FireHOL,
you can just include the extras/shaper.conf file into the beginning of /etc/firehol/firehol.conf;iptables-mark.sh or shaper.conf, check those files for the
MARK_DEVICE variable. It must point to the same interface defined in CTShaper's main configuration file
(/etc/ctshaper/ctshaper.conf)./usr/local/sbin/ctshaper start;DOWNLINK/UPLINK values in /etc/ctshaper/ctshaper.conf as explained there (restarting ctshaper as needed);/usr/local/sbin/ctshaper start whenever the interface it is going to shape is
started (if this is a PPP link, and you are using Debian, you can just copy
the script extras/ctshaper-start into /etc/ppp/ip-up.d).iptables-mark.sh, a script that sets up packet marking using only the iptables tool.
This is supposed to ease the lives of those who don't want to learn how to use iptables or those
that aren't using any iptables frontend.tc;Although completely unrecognizable now, CTShaper was initially inspired by Bert Hubert's Wondershaper.