Linux Bandwidth Arbitrator
Linux Bandwidth Arbitrator - Tips & Tricks provided by Rajiv Shah
Hardware requirements
I am
using a Pentium 133 MMX with 32MB RAM to manage the bandwidth on a
network with 5 hosts and a 32kbps connection to the internet.
However, due to the low RAM. I have to clear out my log file and /tmp
directory on a daily basis.
I would
recommend a minimum of 3 network cards – two for the bridge and one
for remote access to the arbitrator.
Remote Access
My
arbitrator sits on the connection to the internet and I have to be
frugal with my limited pool of public ip addresses. I also do not
want any form of access to the arbitrator from the internet or from
other hosts on my internal network. I have therefore added a third
NIC to the arbitrator and used a cross-over cable to connect it to a
second NIC in my desktop.
assign an ip to the third NIC:
ifconfig
eth2 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx up
create a password for user root
using the passwd command at the console
type “/etc/init.d/sshd start”
at the console to start the ssh daemon
I am now
able to connect to the arbitrator from the comfort of my desk
Persistence:
Copy
/etc/passwd to /home/root/floppy
Copy
/etc/ssh_* to /home/root/floppy
Add the
following lines to arbiext:
ifconfig eth2 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx up
cp
/home/root/floppy/passwd /etc
cp /home/root/floppy/ssh_*
/etc
chmod 600 /etc/ssh_*
/etc/init.d/sshd start
Starting the GUI
assign an ip to the arbitrator –
see step 1 in the section on remote access
type in the following commands
at the command prompt:
mkdir
/var/www
cd /var/www
tar zxfv /art/webgui.tar.gz
cp
etc/thttpd.conf /etc
/etc/init.d/thttpd start
browse to
http://xxx.xxx.xxx.xxx/arbi
where xxx.xxx.xxx.xxx is the ip address you assigned to your
arbitrator.
Persistence:
Add the commands in step 2 to arbiext
Formatting a floppy and getting away from 8.3
filenames
Provided by stevew
You can format a floppy in what you
would call drive A in Linux to get away from the DOS 8.3 filename
limitation by doing the following:
if you already have a floppy in
the drive and are using one of the Arbitrator CD's then you will
need to first copy all the files you want to keep to a temporary
location:
mkdir
/home/root/ftemp
cp /home/root/floppy/* /home/root/ftemp
and then
un-mount the floppy with:
umount /home/root/floppy
with a floppy in the drive type:
mke2fs
/dev/fd0
when it
gets done and says so, you have a Linux floppy without the 8.3
limitations that the DOS format had
to mount it again for use with
ArbiCD type:
mount
/dev/fd0 /home/root/floppy
and
copy your files back by typing:
cp
/home/root/ftemp/* /home/root/floppy
you might want to name those
8.3's back to the original names. Renaming files is done with mv.
For example:
mv
arbdefau.con arbdefault.conf
Floppy Booting the CD Distro
Provided by trellis
If you have an older machine whose
BIOS does not support booting from CD, it's very simple to create a
floppy disk with which you can boot into the Arbitrator CD.
grab a copy of Bart's Boot Image
Extractor from http://www.nu2.nu/bbie/
run BBIE on the Arbitrator CD (or the
ISO image), and you'll get a bootable floppy disk image.
use a utility such as WinImage or
Rawrite to write this image onto a floppy disk.
insert the floppy and the CD into the
target machine and boot as normal
My comments:
The floppy produced above will result
in a DOS formatted floppy which will suffer from 8.3 filename
limitations. Following Steve’s tip above to reformat the floppy
using Linux will render the floppy unbootable.
Transferring
files to/from Arbitrator
If you have a computer running Windows 2000 or XP the easiest way to
transfer files to/from the Arbitrator is to:
create a shared directory on the Windows machine with the access
permissions you want to apply (for simplicity I made my shared
directory accessible to everybody)
type the following at the command prompt on the arbitrator:
mkdir /home/shared
smbmount //xxx.xxx.xxx.xxx/winshare
/home/shared –o guest rw
where
xxx.xxx.xxx.xxx is the ip of your Windows machine and winshare is the
share name of the shared folder
any files in the
/home/shared/folder are now actually stored on your Windows machine
but are accessible by both machines
Persistence:
Add the
commands in step 2 to arbiext
If your are using Linux, the above
will work if you are already using Samba to share files with other
Windows machines or you could use NFS.
Using MRTG to plot data from Advanced Reporting
Tools
Using MRTG to plot Arbitrator traffic
data is made a lot easier by first implementing a file transfer
system as described above. Being able to write output from the
shipped reporting tools directly to a shared directory simplifies
matters greatly.
I have added the following line to my
hostlist.report to monitor the amount of all http traffic passing
through the Arbitrator:
xxx.xxx.xxx.xxx/xx HTTP
/home/shared/traffic/http
I am running MRTG on Linux and my cfg
file looks like:
### Global Config Options
WorkDir: /var/www/html/mrtg/arbi
Options[_]:
nopercent,growright,nobanner,noinfo,absolute,bits
#Report on all http traffic
Target[http]: `tail –n 2
/home/shared/traffic/http`
MaxBytes[http]: 1250000
Title[http]: ARBI http traffic
PageTop[http]: ARBI http
traffic