Problems with SER, MySQL & FreeRADIUS
Hello! I'm having some problems when wanting the database of SER to be the one FreeRADIUS will be checking on, instead of the radius database. Like that I changed the file /etc/raddb/sql.conf At the end is the output of the problems. Hope somebody can help, Thanks in advance Roberto #----------------------------------------------------------------------------------------------------------------------------------------------# #SQL.conf sql { driver = "rlm_sql_mysql" server = "localhost" login = "root" password = "**********" # Database table configuration radius_db = "ser" # Allow for storing data after authentication postauth_table = "authenticate" authcheck_table = "subscriber" authreply_table = "subscriber2" ### postauth_table = "radpostauth" ### authcheck_table = "radcheck" ### authreply_table = "radreply" ### groupcheck_table = "radgroupcheck" ### groupreply_table = "radgroupreply" ### usergroup_table = "usergroup" # Table to keep radius client info ### nas_table = "nas" authorize_check_query = "SELECT phplib_id, username, password\ FROM ${authcheck_table} \ WHERE LOWER(username) = LOWER('%{SQL-User-Name}') \ ORDER BY phplib_id" authorize_reply_query = "SELECT phplib_id, username, password\ FROM ${authreply_table} \ WHERE LOWER(username) = LOWER('%{SQL-User-Name}') \ ORDER BY phplib_id" authorize_check_query = "SELECT phplib_id, username, password\ FROM ${authcheck_table} \ WHERE username = '%{SQL-User-Name}' \ ORDER BY phplib_id" authorize_reply_query = "SELECT phplib_id, username, password\ FROM ${authreply_table} \ WHERE username = '%{SQL-User-Name}' \ ORDER BY phplib_id" postauth_query = "INSERT into ${postauth_table} (phplib_id, user, pass, reply, date) values ('', '%{User-Name}', '%{User-Password:-Chap-Password}', '%{reply:Packet-Type}', NOW())" #SQL.conf #----------------------------------------------------------------------------------------------------------------------------------------------# I thought that i neede to create some more tables so here they are Subscriber2 will act like- authcheck_table Authenticate will actlike - postauth_table #----------------------------------------------------------------------------------------------------------------------------------------------# #Tables created in databaseSER CREATE TABLE authenticate ( phplib_id varchar(32) not null default '', user varchar(64) not null default '', pass varchar(25) not null default '', reply varchar(25) not null default '', date datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY phplib_id(phplib_id)); table subsciber had exactly the same structure of subscriber2 CREATE TABLE subscriber2 ( phplib_id varchar(32) NOT NULL default '', $USERCOL varchar(64) NOT NULL default '', domain varchar(128) NOT NULL default '', password varchar(25) NOT NULL default '', first_name varchar(25) NOT NULL default '', last_name varchar(45) NOT NULL default '', phone varchar(15) NOT NULL default '', email_address varchar(50) NOT NULL default '', datetime_created datetime NOT NULL default '0000-00-00 00:00:00', datetime_modified datetime NOT NULL default '0000-00-00 00:00:00', confirmation varchar(64) NOT NULL default '', flag char(1) NOT NULL default 'o', sendnotification varchar(50) NOT NULL default '', greeting varchar(50) NOT NULL default '', ha1 varchar(128) NOT NULL default '', ha1b varchar(128) NOT NULL default '', allow_find char(1) NOT NULL default '0', timezone varchar(128) default NULL, rpid varchar(128) default NULL, domn int(10) default NULL, uuid varchar(64) default NULL, UNIQUE KEY phplib_id (phplib_id), PRIMARY KEY ($USERCOL, domain), KEY user_2 ($USERCOL) ) ; #Tables created in databaseSER #----------------------------------------------------------------------------------------------------------------------------------------------# Output Problems reread_config: reading radiusd.conf Config: including file: /etc/raddb/proxy.conf Config: including file: /etc/raddb/clients.conf Config: including file: /etc/raddb/snmp.conf Config: including file: /etc/raddb/eap.conf Config: including file: /etc/raddb/sql.conf /etc/raddb/sql.conf[243]: Line is not in 'attribute = value' format Errors reading radiusd.conf
Sorry, I made a mistake. I posted an output that had problems Here's the output with the mistakes: rad_recv: Access-Request packet from host 192.168.226.13:36704, id=189, length=206 User-Name = "admin@xxx.xxx.xxx.xxx Digest-Attributes = 0x0a0761646d696e Digest-Attributes = 0x01103139322e3136382e3232362e3133 Digest-Attributes = 0x022a34353031386134373232653237643866613166333663303539343262393938666166333531666263 Digest-Attributes = 0x04147369703a3139322e3136382e3232362e3133 Digest-Attributes = 0x030a5245474953544552 Digest-Response = "19f6c96bf5fe597d0cc2a1fc9a390917" Service-Type = Sip-Session Sip-Uri-User = "admin" NAS-Port = 5060 NAS-IP-Address = xxx.xxx.xxx.xxx Processing the authorize section of radiusd.conf modcall: entering group authorize for request 0 modcall[authorize]: module "preprocess" returns ok for request 0 modcall[authorize]: module "chap" returns noop for request 0 modcall[authorize]: module "mschap" returns noop for request 0 rlm_digest: Converting Digest-Attributes to something sane... Digest-User-Name = "admin" Digest-Realm = "xxx.xxx.xxx.xxx" Digest-Nonce = "45018a4722e27d8fa1f36c05942b998faf351fbc" Digest-URI = "sip:xxx.xxx.xxx" Digest-Method = "REGISTER" rlm_digest: Adding Auth-Type = DIGEST modcall[authorize]: module "digest" returns ok for request 0 rlm_realm: Looking up realm "xxx.xxx.xxx.xxx" for User-Name = " admin@192.168.226.13" rlm_realm: No such realm "xxx.xxx.xxx.xxx" modcall[authorize]: module "suffix" returns noop for request 0 rlm_eap: No EAP-Message, not doing EAP modcall[authorize]: module "eap" returns noop for request 0 users: Matched entry DEFAULT at line 152 modcall[authorize]: module "files" returns ok for request 0 radius_xlat: 'admin' rlm_sql (sql): sql_set_user escaped user --> 'admin' radius_xlat: 'SELECT phplib_id, username, password FROM subscriber WHERE LOWER(username) = LOWER('admin') ORDER BY phplib_id' rlm_sql (sql): Reserving sql socket id: 4 Segmentation fault On 9/8/06, Roberto Lopes <roberto.projectos@gmail.com> wrote:
Hello! I'm having some problems when wanting the database of SER to be the one FreeRADIUS will be checking on, instead of the radius database. Like that I changed the file /etc/raddb/sql.conf At the end is the output of the problems. Hope somebody can help, Thanks in advance Roberto
#----------------------------------------------------------------------------------------------------------------------------------------------# #SQL.conf
sql { driver = "rlm_sql_mysql"
server = "localhost" login = "root" password = "**********"
# Database table configuration radius_db = "ser"
# Allow for storing data after authentication postauth_table = "authenticate" authcheck_table = "subscriber" authreply_table = "subscriber2" ### postauth_table = "radpostauth" ### authcheck_table = "radcheck" ### authreply_table = "radreply"
### groupcheck_table = "radgroupcheck" ### groupreply_table = "radgroupreply" ### usergroup_table = "usergroup" # Table to keep radius client info ### nas_table = "nas"
authorize_check_query = "SELECT phplib_id, username, password\ FROM ${authcheck_table} \ WHERE LOWER(username) = LOWER('%{SQL-User-Name}') \ ORDER BY phplib_id" authorize_reply_query = "SELECT phplib_id, username, password\ FROM ${authreply_table} \ WHERE LOWER(username) = LOWER('%{SQL-User-Name}') \ ORDER BY phplib_id"
authorize_check_query = "SELECT phplib_id, username, password\ FROM ${authcheck_table} \ WHERE username = '%{SQL-User-Name}' \ ORDER BY phplib_id" authorize_reply_query = "SELECT phplib_id, username, password\ FROM ${authreply_table} \ WHERE username = '%{SQL-User-Name}' \ ORDER BY phplib_id"
postauth_query = "INSERT into ${postauth_table} (phplib_id, user, pass, reply, date) values ('', '%{User-Name}', '%{User-Password:-Chap-Password}', '%{reply:Packet-Type}', NOW())"
#SQL.conf #----------------------------------------------------------------------------------------------------------------------------------------------#
I thought that i neede to create some more tables so here they are Subscriber2 will act like- authcheck_table Authenticate will actlike - postauth_table
#----------------------------------------------------------------------------------------------------------------------------------------------#
#Tables created in databaseSER
CREATE TABLE authenticate ( phplib_id varchar(32) not null default '', user varchar(64) not null default '', pass varchar(25) not null default '', reply varchar(25) not null default '', date datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY phplib_id(phplib_id));
table subsciber had exactly the same structure of subscriber2
CREATE TABLE subscriber2 ( phplib_id varchar(32) NOT NULL default '', $USERCOL varchar(64) NOT NULL default '', domain varchar(128) NOT NULL default '', password varchar(25) NOT NULL default '', first_name varchar(25) NOT NULL default '', last_name varchar(45) NOT NULL default '', phone varchar(15) NOT NULL default '', email_address varchar(50) NOT NULL default '', datetime_created datetime NOT NULL default '0000-00-00 00:00:00', datetime_modified datetime NOT NULL default '0000-00-00 00:00:00', confirmation varchar(64) NOT NULL default '', flag char(1) NOT NULL default 'o', sendnotification varchar(50) NOT NULL default '', greeting varchar(50) NOT NULL default '', ha1 varchar(128) NOT NULL default '', ha1b varchar(128) NOT NULL default '', allow_find char(1) NOT NULL default '0', timezone varchar(128) default NULL, rpid varchar(128) default NULL, domn int(10) default NULL, uuid varchar(64) default NULL, UNIQUE KEY phplib_id (phplib_id), PRIMARY KEY ($USERCOL, domain), KEY user_2 ($USERCOL) ) ; #Tables created in databaseSER
#----------------------------------------------------------------------------------------------------------------------------------------------#
Output Problems
reread_config: reading radiusd.conf Config: including file: /etc/raddb/proxy.conf Config: including file: /etc/raddb/clients.conf Config: including file: /etc/raddb/snmp.conf Config: including file: /etc/raddb/eap.conf Config: including file: /etc/raddb/sql.conf /etc/raddb/sql.conf[243]: Line is not in 'attribute = value' format Errors reading radiusd.conf
"Roberto Lopes" <roberto.projectos@gmail.com> wrote:
rlm_sql (sql): Reserving sql socket id: 4 Segmentation fault
doc/bugs Alan DeKok. -- http://deployingradius.com - The web site of the book http://deployingradius.com/blog/ - The blog
participants (2)
-
Alan DeKok -
Roberto Lopes