Hi,
I'm experiencing problems with Simultaneous-Use and MySQL.
Due I have two freeradius servers, I cannot use for accounting radutmp because
if a radius gets a stop packet and the start one went to the other radius the
driver fails, so all accounting is based on MySQL.
The MySQL queries that the radius perform are the followings (using standard
sql.conf file with simul_count_query uncommented, the file is attached)
1- authorize_check_query (gets the Simultaneous-Use := 1)
2- authorize_group_check_query
3- authorize_reply_query
4- authorize_group_reply_query
5- simul_count_query
6- postauth_query
7- accounting_start_query
8- accounting_update_query (updates the radacct table with the IP address from
the pool)
If I try to connect with the same user and the previous conection still
established, this is the sequence of queries:
1- authorize_check_query
2- authorize_group_check_query
3- authorize_reply_query
4- authorize_group_reply_query
5- simul_count_query **returns 1**
6- simul_verify_query
7- accounting stop query **performs a stop in the previously established
session**
8- postauth_query
9- accounting_start_query
10- accounting_update_query (updates the radacct table with the IP address
from the pool)
I think either simul_verify_query is wrong or there is something wrong with
sql.conf. I've attached it.
If I change Simultaneous-Use := 0 the user cannot connect as I should behave
and the logs reports Auth: Multiple logins (max 0)
Freeradius and freeradius-mysql are etch/testing packages Debian official
packages (version 1.0.4-2)
Any help would be appreciated, thanks in advance
--
David
#
# Configuration for the SQL module, when using MySQL.
#
# The database schema is available at:
#
# src/radiusd/src/modules/rlm_sql/drivers/rlm_sql_mysql/db_mysql.sql
#
# If you are using PostgreSQL, please use 'postgresql.conf', instead.
# If you are using Oracle, please use 'oracle.conf', instead.
# If you are using MS-SQL, please use 'mssql.conf', instead.
#
# $Id: sql.conf,v 1.41.2.1 2004/06/10 00:45:01 phampson Exp $
#
sql {
# Database type
# Current supported are: rlm_sql_mysql, rlm_sql_postgresql,
# rlm_sql_iodbc, rlm_sql_oracle, rlm_sql_unixodbc, rlm_sql_freetds
driver = rlm_sql_mysql
# Connect info
server = mysql.server.com
login = mysql.user
password = mysql.pass
# Database table configuration
radius_db = radius.table
# If you want both stop and start records logged to the
# same SQL table, leave this as is. If you want them in
# different tables, put the start table in acct_table1
# and stop table in acct_table2
acct_table1 = radacct
acct_table2 = radacct
# Allow for storing data after authentication
postauth_table = radpostauth
authcheck_table = radcheck
authreply_table = radreply
groupcheck_table = radgroupcheck
groupreply_table = radgroupreply
usergroup_table = usergroup
# Remove stale session if checkrad does not see a double login
deletestalesessions = yes
# Print all SQL statements when in debug mode (-x)
sqltrace = no
sqltracefile = ${logdir}/sqltrace.sql
# number of sql connections to make to server
num_sql_socks = 5
# number of seconds to dely retrying on a failed database
# connection (per_socket)
connect_failure_retry_delay = 60
# Safe characters list for sql queries. Everything else is replaced
# with their mime-encoded equivalents.
# The default list should be ok
#safe-characters =
@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /
###
# Query config: Username
###
# This is the username that will get substituted, escaped, and added
# as attribute 'SQL-User-Name'. '%{SQL-User-Name}' should be used
below
# everywhere a username substitution is needed so you you can be sure
# the username passed from the client is escaped properly.
#
# Uncomment the next line, if you want the sql_user_name to mean:
#
#Use Stripped-User-Name, if it's there.
#Else use User-Name, if it's there,
#Else use hard-coded string DEFAULT as the user name.
#sql_user_name = %{Stripped-User-Name:-%{User-Name:-DEFAULT}}
#
sql_user_name = %{User-Name}
###
# Default profile
###
# This is the default profile. It is found in SQL by group membership.
# That means that this