Free Radius + Informix Howto
Written by Brad Dixon
This Howto is for those users still tinkering with the Informix SE Database engine and
would like to have a go at Authenticating and sending Accounting logs to this type of server.
It assumes that your knowledge of Unix and Informix is fair as I have only touched
on the parts that will cause you grief it is not a complete manual.
Software used -
freeradius-1.0.0 (The Radius Server) http://www.freeradius.org
Informix 7.x
unixODBC-2.2.5-ansi (To conect to the Database server) http://www.unixodbc.org
Database server
- Informix Tables
Set up you Informix as normal on the Database server.
Make sure you can connect to the server with dbaccess.
Now build the tables requied for Freeradius.
I used the following sql files which have been taking from the Free Radius distribution
and altered for Informix radinformix.sql
(you may want to change the AcctInputOctets & AcctOutputOctets to suite your requirements).
Radius Server
- Informix
Install your informix connectors to this server.
Make sure you can connect from this server to your main database server.
If you cannot, check your hosts.equiv or .rhosts or sqlhosts.
- Unix Odbc
MAKE SURE YOU DOWNLOAD THE RIGHT VERSION. (The ANSI version).
From there the installation is pretty straight forward install the Unixodbc as per instructions and create both
odbcinst.ini -
[ODBC]
Trace = No
TraceFile = /tmp/odbc.log
ForceTrace = No
Pooling = No
FileUsage = 1
[Informix]
Description = Informix
Driver = /usr/informix/lib/cli/libifcli.so
APILevel = 1
ConnectFunctions = YYY
DriverODBCVer = 03.00
FileUsage = 1
smProcessPerConnect = Y
odbc.ini -
[radius]
Driver=Informix
Description=Informix
Trace=No
TraceFile=/tmp/odbc.log
Server=demo_se
Database=radius
LogonID=mylogin
pwd=mypasswd
CLIENT_LOCALE=en_us.8859-1
DB_LOCALE=en_us.8859-1
TRANSLATIONDLL=/usr/informix/lib/esql/igo4a304.so
Port=myport
You should be able to test this now with -
>isql radius
This should connect you to your database.
>help radacct
Should show you your radacct table.
If not check the following -
ODBCINI (environment variable)
sqlhost
hosts.equiv
.rhosts
- Radius Server
This is pretty much stock standard. The main problem is that after the radius server
queries the database for an attribute it is returned with the trailing white space.
This needs to be stripped.
I have added code to sql.c in the rlm_sql modules which calls trimStr
Sql.c (for freeradius1.0.0)
After changing/copying this code. Compile freeradius as normal and install.
Install the rlm_sql and driver for iodbc.
Your sql.conf file in the freeradius will need a little editing I
have provided on here if you require assitance.
sql.conf
Once all is configured you will need to make sure you have any extra environment
variables added to your radius startup script.
Now fire it up..