Slackware Linux 10.0 Kernel 2.4.28 Bridging - OPTIONAL - use this only if you use all these programs on dedicated servers HTB tool - limit/guarantee upload and download ![]()
// Begin disclaimer // I'm not responsible for the way you use this information. It is the description that I have used and it works in the conditions that I have described. If the computer on which you install & configure htb-tools, bridging goes insane or breaks - it's not my responsability. // End disclaimer // |
Slackware Linux 10.0 http://www.slackware.com Install Slackware Linux - Slackware-HOWTO - in english Install Slackware Linux - Slackware-HOWTO - in romanian
Kernel 2.4.28 http://www.kernel.org - the default kernel in slackware linux 10.0 can be used, it already has all needed options preselected - if you compile from sources, you will need the following options for HTB:
#
Linux bridging http://bridge.sourceforge.net - prior to using bridge utilities you need to compile kernel support for bridging:
#
- download bridging utilities
- before you begin compiling, make sure that the two NICs are properly set, meaning the drivers are loaded and working
DO NOT SET ANY IP ON THE NICs, DEACTIVATE ANY SCRIPT THAT MIGHT SET IPs ON THE NICs (DHCP)
run ifconfig eth0 down and ifconfig eth1 down to make sure
there is no active NIC, deactivate even the loopback ifconfig lo down. The IPs will be set after the utilities are compiled/installed.
- configure; make; make install - these are the commands
that need to be ran after extracting the sources;
HTB tool - http://www.arny.ro/htb/htb_tools-0.2.5.tar.gz Hierarchical Token Bucket ( HTB ) successfully replaces Class Based Queueing ( CBQ ) due to the precise and easy to understand for everybody way it operates. The diference to CBQ is that bandwidth is allocated to one (or more) class, and the moment when the bandwidth that is allocated to the class is overrun, it can borrow (temporary) bandwidth from other class which does not use all bandwidth. More then that, unlike CBQ, you can allocate several clients to one class. All clients and classes are defined in a configuration file
Using a series of programs (HTB
Tools) you can simplify the configuration and monitoring of bandwidth
allocations for both upload and download. To better understand how it works, the example will use a 256kbps bandwidth, shared by 4 clients, each client having 48kbps guaranteed, and max 64kbps upload/download (48 kbps CIR, 64 kbps MIR). - download the sources htb_tools-0.2.5.tar.gz from http://www.arny.ro/htb/htb_tools-0.2.5.tar.gz
- extract and compile the sources:
- after compiling you will have the bin files q_parser, q_show and q_checkcfg;
- the config files from /etc/htb will be checked to be corect:
q_checkcfg /etc/htb/eth0-qos.cfg Class class_1, CIR: 192, MIR: 256 ** 4 clients, CIR2: 192, MIR2: 256 1 classes; CIR / MIR = 192 / 256; CIR2 / MIR2 = 192 / 256 q_checkcfg /etc/htb/eth1-qos.cfg
Class class_1, CIR: 192, MIR: 256 ** 4 clients, CIR2: 192, MIR2: 256 1 classes; CIR / MIR = 192 / 256; CIR2 / MIR2 = 192 / 256
I've made a script for those who use
Slackware Linux. Using this script you can start/stop/monitor alocated/used
bandwidth for upload or download or both. To start the bandwidth policies at boot you need to put in /etc/rc.local this line: - if you wish to limit/guarantee bandwidth only for download the you use:
-
if you wish to limit/guarantee the bandwidth only for upload, then you use: The q_show binary alllow you to watch, in real time, the traffic & and the load
for each client (download) - you will see the traffic & load
Configuring - add this to crontab (crontab -e): (for details read web/README-en) */1 * * * * /sbin/q_show -i eth1 -f /etc/htb/eth1-qos.cfg -1 > /var/www/htdocs/webhtbb/q_show.log
To view the web page with the traffic statistics, type in your browser: http://www.mydomain.com/webhtb/q_show.php
Documentation: Install Slackware Linux - Slackware-HOWTO - in english Install Slackware Linux - Slackware-HOWTO - in romanian Linux Advanced Routing & Traffic Control HOWTO http://www.lartc.org or http://www.docum.org/; Bridging HOWTO http://bridge.sourceforge.ne t/howto.html
HTB - tools Implementing
Real Time Packet Forwading Policies using HTB. |