columbus : an automatic network detector and configurator

columbus is useful when you use your machine in different networks.  It is 
great for laptop users.

columbus uses ARP pings to look for known MAC-IP address correspondences.
It can do this even when no IP address has been assigned yet, which is a 
good idea when you are on a new network.

columbus can be hooked up to your network script.  It can also be hooked 
up to your apmd and be told to re-check the network each time the computer 
wakes up.

columbus also has a modified version of one of Donald Becker's link check 
tools.  This way it will check your network when your network cable is 
plugged back in and if necessary, execute all synchronisation steps.

Motivation
----------
I always wrote quick and dirty network setting scripts for computers I 
moved around.  They were always really simple and had to be done manually.
One day I decided enough was enough.  I found two tools, divine and 
ethereal (one copied from the other, apparently).  I could get neither of 
them to work ok.  And, anyway, they seemed to complicated when a set of 
nice shell scripts would do.

So, I coded up columbus one night and tested it for two weeks.  It never 
fails to detect the right settings once configured properly.  So I hope it 
may prove useful to you as well.

Disclaimer
----------
While columbus works great for me (on Red Hat 7.2), this is alpha software 
and you should first take a look at it and verify if it will do the right 
thing on your system. RH7x users should be fine; I can't guarantee it will 
work on other systems because it hasn't been tested yet.

Also, the daemonized stuff is written for RH7.  It is easy to adapt it to 
other systems, IMO, so let me know if you do.

How it works
------------
columbus itself has a few options.  Run columbus -h to see them.  It needs 
to be run as root because otherwise arping will not run.

Running it without options will tell you what network columbus thinks it's 
on.

When you ask it to sync the network settings, it will look up what network 
it's on based on information in /etc/columbus/networks.  It will then 
apply these network settings.  In effect, this means it will re-symlink 
all of the files in the stripped root directory /etc/columbus/[network].
I personally have, in each of these dirs (one for each network) :
/etc/hosts
/etc/resolv.conf
/etc/sysconfig/network

You have to create these files by hand, or copy them from your current 
settings.

You can also add shell scripts to be executed before or after symlinking 
these files; put these scripts in /etc/columbus and name them 
post.[network] and pre.[network]

Configuration
-------------
/etc/columbus/networks
	Each MAC-IP-net correspondence is put on one line.
	The syntax is [MAC]\t[IP]\t[net]
	where
		MAC is a six-byte double-dotted address
		IP is a four-byte dotted ip address
		net is the canonical name of your network/location

	You need to fill in useful information here for columbus to work !

/etc/columbus/[network]
	a stripped root tree containing files that will be symlinked for 
	this network configuration by columbus

/etc/columbus/current
	This file contains the canonical name of the network for which
	settings have last been loaded.

Red Hat
-------
I'm a Red Hat user, so I added hooks to apmd and in the runlevels to make 
columbus start up at boot time, have columbus log everything to syslog and 
also have viking run in the background to check link status.  It works 
seemlessly for me, I take my laptop home and plug it back in and it 
autodetects the network and does all the right things.

If you're on Red Hat, the easiest thing would be to install the RPM or 
rebuild the SRPM.
Columbus is verified to work correctly on Red Hat 7.2

Debian
------
I don't have Debian atm, so if any of you debian people could take a look 
and help me out with getting it properly set up for debian, I'd be very 
grateful.
