Back To MAN Pages From BackTrack 5 R1 Master List
The purpose of this module is to de-couple the storage of long-term accounting data in SQL from "live" information needed by the RADIUS server as it's running. If you are not using SQL for simultaneous login restrictions (i.e. "sql" is not listed in the "session" section of "radiusd.conf"), then this module allows you to log SQL queries to a file, and then process them at your leisure.
The benefit of this approach is that for a busy server, the overhead of performing SQL qeuries may be significant. Also, if the SQL databases are large (as is typical for ones storing months of data), the INSERTs and UPDATEs may take a relatively long time. Rather than slowing down the RADIUS server by having it interact with a database, you can just log the queries to a file, and then run those queries on another machine, or at a time when the RADIUS server is typically lightly loaded.
If the "sql" module is listed in the "session" section of "radiusd.conf", then a similar system can still be used. In that case, one database would be used to maintain "live" session information. That database would be small, fast, and information would be deleted from it when a user logs out. A second database would store long-term accounting information, as described above.
modules { ...
sql_log {
path = "${radacctdir}/sql-relay"
acct_table = "radacct"
postauth_table = "radpostauth"
sql_user_name = "%{%{User-Name}:-DEFAULT}"
Start = "INSERT INTO ${acct_table} ..."
Stop = "UPDATE ${acct_table} SET ..."
Alive = "UPDATE ${acct_table} SET ..."
Post-Auth = "INSERT INTO ${postauth_table} ..."
}
...
}
accounting { ...
sql_log ...
}
post-auth { ...
sql_log ...
}
If you would like to republish one of the articles from this site on your webpage or print journal please contact IronGeek.
Copyright 2020, IronGeek