Hi al..
I just write program that helps to configure tc with HTB and iptables CLASS
extension.
Its written in perl and uses Apache like config files.
Program can be found on http://sourceforge.net/projects/ist-shaper/ or
http://www.ingwar.eu.org/ist-shaper/
In few days will be new version with time aware rules.
The simply config file looks like this.
############################################################################
###
# It''s a simple example of a config file for Ist Shaper
# It only prioritizes outgoing traffic on interface eth0 (128Kbit bandwidth)
# by source and destination port.
#
#
+--------------------------------------------------------------------------+
# | htb 1:1 128Kbit
|
#
+------------------------+------------------------+------------------------+
# | htb 1:10 96Kbit prio 1 | htb 1:10 64Kbit prio 2 | htb 1:10 32Kbit prio 3
|
#
+------------------------+------------------------+------------------------+
# | ssh/telnet/dns | http/https/pop3/smtp | rest
|
#
+------------------------+------------------------+------------------------+
#
# Root rule (htb 1:1) divides into 3 classess, each allocating part of total
# bandwidth (96Kbit, 64Kbit, 32Kbit).
#
# More complex and working example can by found in file complex.conf
#
############################################################################
###
# location of log file
Log_file = /var/log/ist.log
# use RETURN target for each rule in class to avoid re-classifing of packets
# generaly it''s good idea
Return_Rules = 1
############################################################################
###
# interfaces
############################################################################
###
# outgoing interface (128Kbit)
<Device eth0>
# Total bandwidth for a device (default 128Kbit)
Rate = 128Kbit
# default class for qdisc, it is used only if NO OTHER rule will match.
# It should be empty, used only by tc
Default = 30
###########################################################################
# classes
###########################################################################
# Highest priority rule, for interactive sessions, like SSH/telnet/etc
<Class 10>
Rate = 96Kbit
Prio = 1
Rule = -p tcp --source-port ssh
Rule = -p tcp --destination-port ssh
Rule = -p tcp --source-port telnet
Rule = -p tcp --destination-port telnet
Rule = -p udp --source-port domain
Rule = -p udp --destination-port domain
</Class>
# Next rule for services that need some bandwidth, but not so demanding
# as interactive sessions (like www browsing... you wouldn''t notice
# page being loaded 0.5 second longer, but in SSH you would)
<Class 20>
Rate = 64Kbit
Prio = 2
Rule = -p tcp --source-port http
Rule = -p tcp --destination-port http
Rule = -p tcp --source-port https
Rule = -p tcp --destination-port https
Rule = -p tcp --source-port pop3s
Rule = -p tcp --destination-port pop3s
Rule = -p tcp --source-port smtp
Rule = -p tcp --destination-port smtp
</Class>
# all of the rest.... (of corse you could add more classes, look for
them in
# complex.conf example)
# This class is default one (See line above defining "Default"),
it is
not
# defined in iptables, used only in tc.
<Class 30>
Rate = 32Kbit
Prio = 3
</Class>
</Device>
--
Lemmings don''t grow older, they just die.