Installation Instructions

Unfortunately setting up Link-n-Log is not as easy as I'd like it to be. I don't think its too hard, so don't get discouraged, but at some point I'd like to add a wizard or a script that automates all of this.

First of all you need to configure your Linksys device to send its SNMP trap messages to the machine that will be running the Daemon which logs the data to the database. On my device (a BEFSR41) this is accomplished by pointing my web browser to http://192.168.1.1 which logs you in to the administrative functions of your router. Hopefully this is password protected. Once you've logged into your device go to the info tab and enable SNMP traps and set the device to send those traps to the machine that will run the Daemon. I have the traps sent to 192.168.1.10, so my logs setup looks like:

Now you're ready to build Link-n-Log. The distribution includes 2 binaries which were built on my Redhat 8.0 machine. They may work for you (although they won't work until you've completed the configuration instructions below). If they do, great. If not you'll need to build them again. This can be accomplished by first removing GUI/Link-n-Log and Daemon/linknlogd and then running:

export QTDIR=[your qt dir]
qmake Link-n-Log.pro
make

Where [your qt dir] is the directory where the QT development libraries are installed (/usr/lib/qt3 on my machine). If you don't have these libraries they can be downloaded from trolltech, or you should be able to find rpm's or deb packages for your distro.

Configuration

There are three steps to configure Link-n-Log
  1. Set up the MySQL database
  2. Set up the initialization file
  3. Move the binaries to their final home
None should take you more than 2 minutes.

MySQL Setup

I will not cover how to set up users and permissions in MySQL as that is beyond the scope of this install file. The mysql web site contains excellent documentation about this.

You will need to create a database where the alerts can be logged. This database will also contain the port list database (kindly provided by the good folks at Neohapsis.com) that allows you to map ports to services. Do the following:

mysql -u [user] -p[password] -h [host] < dbsetup.sql

where [user] is a MySQL user that has permissions to create new databases, [password] is the MySQL password for that user (recall that, MySQL uses different users than Linux so the MySQL user "root" and the Linux user "root" are not the same. Also note that there is no space between the -p and the password) and [host] is the host where the database resides (if the database is on the same machine where you're running the above commands use "localhost" for the host value). The dbsetup.sql file should be in the main directory containing all the source code.

ini File Setup

You now need to edit the Link-n-Log.ini file and move copies of it to the appropriate places. Both the GUI and Daemon parts of the software use this file to get information about the database. They look for the file in ~/.Link-n-Log/Link-n-Log.ini where "~" is the home directory of the user. Thus if you plan to run the Daemon as root and the GUI as user george you'll need a copy of the Link-n-Log.ini file in /root/.Link-n-Log/Link-n-Log.ini and /home/george/.Link-n-Log/Link-n-Log.ini. The parameters in these two files do not need to be the same - thus you can have the Daemon log to the database as a MySQL user with different permissions that the MySQL user used by the GUI to view the data.

The only things that need to be changed in the supplied Link-n-Log.ini file are probably the username and password. They should reflect the username and password of the MySQL user that you want to access the database.

Move the files

The build process will create 2 separate executables. In the GUI subdirectory a file called "Link-n-Log" is created. This is the GUI part of the application that allows you to view alerts in the database.

In the Daemon directory a file called "linknlogd" is created. This is the Daemon that listens for SNMP traps (UDP port 162) generated by the Linksys router and logs the data to the database. The Daemon should be left running so it can log all the alerts to the database. The Daemon generally needs to be run as root as it needs to be able to listen to UDP port 162 which is a privileged port.

Copy the GUI and the Daemon executables to the location of your choice and you're up and running. If you want to create a desktop link to the application in Gnome or KDE a nice little icon (that's supposed to look like a firewall make out of lincoln logs) is supplied.