diff options
author | 2003-08-17 18:34:53 +0000 | |
---|---|---|
committer | 2003-08-17 18:34:53 +0000 | |
commit | 49fb8024469c33b1a021dbcd471e009b71c1099b (patch) | |
tree | 9816e8c545769228795a9c9377f60d68a2d02b0b /net-misc/htbinit/files | |
parent | Fix mirror list for rc1 (diff) | |
download | gentoo-2-49fb8024469c33b1a021dbcd471e009b71c1099b.tar.gz gentoo-2-49fb8024469c33b1a021dbcd471e009b71c1099b.tar.bz2 gentoo-2-49fb8024469c33b1a021dbcd471e009b71c1099b.zip |
First release
Diffstat (limited to 'net-misc/htbinit/files')
-rw-r--r-- | net-misc/htbinit/files/digest-htbinit-0.8.4 | 1 | ||||
-rw-r--r-- | net-misc/htbinit/files/htb.sysconfig | 265 | ||||
-rw-r--r-- | net-misc/htbinit/files/rc_htbinit | 53 |
3 files changed, 319 insertions, 0 deletions
diff --git a/net-misc/htbinit/files/digest-htbinit-0.8.4 b/net-misc/htbinit/files/digest-htbinit-0.8.4 new file mode 100644 index 000000000000..7562b70efeb5 --- /dev/null +++ b/net-misc/htbinit/files/digest-htbinit-0.8.4 @@ -0,0 +1 @@ +MD5 2baa55f336f87739c5184c87b9973345 htb.init-v0.8.4 31345 diff --git a/net-misc/htbinit/files/htb.sysconfig b/net-misc/htbinit/files/htb.sysconfig new file mode 100644 index 000000000000..6c03c4233d1a --- /dev/null +++ b/net-misc/htbinit/files/htb.sysconfig @@ -0,0 +1,265 @@ +#!/bin/bash + +# This is the main script to build the configuration +# files in the format proposed by htb.init + +# By default, if nothing is modified, the generated files +# are adequate to create classes that control minimum latency +# and maximum throughput traffic. + +# But two (2) more classes are created, one specific for web traffic (port 80) +# and a 'default' class for the rest. Normally, web traffic is considered of minimum +# latency and that's the way we have configured it (it has a higher priority +# than the maximum throughput and default), but it has it's own class because +# of it's importance, so you could assign it a different class from ssh, dns, etc. + +# If you want to adjust the values for your own connection, +# it will be enough to know the download and dowload bandwidth +# to automatically adjust the RATE and CEIL values of each class. +# When you are done, don't forget to execute: +# +# /etc/init.d/htb.init recreate +# /etc/init.d/htb.init reload +# +# to rebuild the configuration files and restart the service. + +# By default the values are calculated for a 256Kbits download +# and 128 Kbits upload bandwidth, very commom in Spain. +# +# NOTE: all values should be around 95-98% aprox. of the real ones +# to be shure the queue is managed in your Linux router. +######################################################## + +############################################################## +## WARNING: DON'T DELETE THE LINES WITH '/bin/cat' OR 'EOF' ## +############################################################## +# The htb.sysconfig script use the command 'cat' to generate # +# the config files necesary for htb.init # +############################################################## + +# I have considere NET like Internet zone, LOC the local network +# and DMZ the dmz zone. Modify to your needs. +NET=eth0 +LOC=eth1 +DMZ=eth2 + +######################################################## +# --- Configuration files for NET zone. +######################################################## +# Allowed keywords are DEFAULT, R2Q, DCACHE. +/bin/cat > /etc/htbinit/$NET << EOF +DEFAULT=40 +EOF + +# Maximum for root class +# Allowed keywords are RATE, BURST, CBURST, INJECT, MTU +/bin/cat > /etc/htbinit/$NET-2.root << EOF +RATE=122Kbit +BURST=2k +EOF + +# Values for minimum latency class +# Typical services: ssh, telnet, ftp, irc, dns, smtp, pop3, imap2 +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +/bin/cat > /etc/htbinit/$NET-2:10.minlatency << EOF +CEIL=122Kbit +RATE=6Kbit +BURST=2K +LEAF=sfq +PRIO=3 +RULE=:22 +RULE=:21 +RULE=:23 +RULE=:6667 +RULE=:53 +RULE=:25 +RULE=:110 +RULE=:143 +EOF + +# Values for maximum throughput class +# Typical services: ftp-data. +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +/bin/cat > /etc/htbinit/$NET-2:20.maxthroughput << EOF +CEIL=115Kbit +RATE=55Kbit +BURST=2K +LEAF=sfq +PRIO=5 +RULE=:20 +EOF + +# Values for web traffic +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +/bin/cat > /etc/htbinit/$NET-2:30.www << EOF +CEIL=122Kbit +RATE=31Kbit +BURST=2K +LEAF=sfq +PRIO=4 +RULE=:80 +RULE=:443 +EOF + +# Values for default class +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +/bin/cat > /etc/htbinit/$NET-2:40.default << EOF +CEIL=122Kbit +RATE=30Kbit +BURST=2k +LEAF=sfq +PRIO=6 +EOF + +######################################################## +# --- Configuration files for local zone (eth1). +######################################################## +# Allowed keywords are DEFAULT, R2Q, DCACHE. +/bin/cat > /etc/htbinit/$LOC << EOF +DEFAULT=40 +EOF + +# Maximum for root class +# Allowed keywords are RATE, BURST, CBURST, INJECT, MTU +/bin/cat > /etc/htbinit/$LOC-2.root << EOF +RATE=244Kbit +BURST=2k +EOF + +# Values for minimum latency class +# Typical services: ssh, telnet, ftp, irc, dns, smtp, pop3, imap2 +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +/bin/cat > /etc/htbinit/$LOC-2:10.minlatency << EOF +CEIL=244Kbit +RATE=12Kbit +BURST=2K +LEAF=sfq +PRIO=3 +RULE=:22, +RULE=:21, +RULE=:23, +RULE=:6667, +RULE=:53, +RULE=:25, +RULE=:110, +RULE=:143, +EOF + +# Values for maximum throughput class +# Typical services: ftp-data. +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +/bin/cat > /etc/htbinit/$LOC-2:20.maxthroughput << EOF +CEIL=230Kbit +RATE=110Kbit +BURST=2K +LEAF=sfq +PRIO=5 +RULE=:20, +EOF + +# Values for web traffic +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +/bin/cat > /etc/htbinit/$LOC-2:30.www << EOF +CEIL=244Kbit +RATE=61Kbit +BURST=2K +LEAF=sfq +PRIO=4 +RULE=:80, +RULE=:443, +EOF + +# Values for default class +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +/bin/cat > /etc/htbinit/$LOC-2:40.default << EOF +CEIL=244Kbit +RATE=61Kbit +BURST=2k +LEAF=sfq +PRIO=6 +EOF + +######################################################## +# --- Configuration files for DMZ (eth2). +######################################################## +# WARNING: the values in the DMZ zone are merely orientative, this is, +# take them just as an academic example. If you have such a zone, +# uncomment the needed parts and adjust all values. Remember, +# download and upload traffic are shared by the local and dmz zone. +# Of course, we suppose you are offering such services in the DMZ. +# Allowed keywords are DEFAULT, R2Q, DCACHE. +#/bin/cat > /etc/htbinit/eth2 << EOF +#DEFAULT=40 +#EOF + +# Maximum for root class +# Allowed keywords are RATE, BURST, CBURST, INJECT, MTU +#/bin/cat > /etc/htbinit/$DMZ-2.root << EOF +#RATE=244Kbit +#BURST=2k +#EOF + +# Values for minimum latency class +# Typical services: ssh, telnet, ftp, irc, dns, smtp, pop3, imap2 +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +#/bin/cat > /etc/htbinit/$DMZ-2:10.minlatency << EOF +#CEIL=244Kbit +#RATE=12Kbit +#BURST=2K +#LEAF=sfq +#PRIO=3 +#RULE=:22 +#RULE=:21 +#RULE=:23 +#RULE=:6667 +#RULE=:53 +#RULE=:25 +#RULE=:110 +#RULE=:143 +#EOF + +# Values for maximum throughput class +# Typical services: ftp-data. +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +#/bin/cat > /etc/htbinit/$DMZ-2:20.maxthroughput << EOF +#CEIL=230Kbit +#RATE=110Kbit +#BURST=2K +#LEAF=sfq +#PRIO=5 +#RULE=:20 +#EOF + +# Values for web traffic +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +#/bin/cat > /etc/htbinit/$DMZ-2:30.www << EOF +#CEIL=244Kbit +#RATE=61Kbit +#BURST=2K +#LEAF=sfq +#PRIO=4 +#RULE=:80 +#RULE=:443 +#EOF + +# Values for default class +# Allowed keywords are RATE, CEIL, BURST, CBURST, INJECT, PRIO, +# LEAF, MTU, QUANTUM, PERTURB, RULE, REALM, MARK, TIME +#/bin/cat > /etc/htbinit/$DMZ-2:40.default << EOF +#CEIL=244Kbit +#RATE=61Kbit +#BURST=2k +#LEAF=sfq +#PRIO=6 +#EOF diff --git a/net-misc/htbinit/files/rc_htbinit b/net-misc/htbinit/files/rc_htbinit new file mode 100644 index 000000000000..2679e4853b51 --- /dev/null +++ b/net-misc/htbinit/files/rc_htbinit @@ -0,0 +1,53 @@ +#!/sbin/runscript +# +# (c) 2003 Juan J. Prieto <jjptapia@eresmas.com> +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# === +# +# htbinit +# +# A shell-script wrapper for HTB.INIT designed for +# use in the SysV-init system (/etc/init.d). +# +# usage: htbinit { start | stop | restart | reload | recreate | stats } +# + +depend() { + need net +} + +start() { + ebegin "Starting htbinit" + /usr/sbin/htbinit start + eend $? +} + +stop() { + ebegin "Stopping htbinit" + /usr/sbin/htbinit stop + eend $? +} + +reload() { + ebegin "Reloading htbinit" + /usr/sbin/htbinit start invalidate + eend $? +} + +recreate() { + ebegin "Recreating htbinit config files" + /bin/rm -rf /etc/htbinit/* + /usr/sbin/htb.sysconfig + einfo "htbinit (QoS) ... recreated. Use \"reload\" to load the new configuration." + eend $? +} + +stats() { + ebegin "Showing htbinit stats" + /usr/sbin/htbinit stats + eend $? +} |