[ previous ] [ next ] [ threads ]
 
 From:  YvesDM <ydmlog at gmail dot com>
 To:  m0n0wall <m0n0wall at lists dot m0n0 dot ch>
 Subject:  Freeradius, mysql, please help!!!
 Date:  Wed, 12 Apr 2006 16:59:14 +0200
Hi,

I'm getting desperate here.
I've been trying for a week now to make freeradius work with mysql.
Can someone please help me out here?

Tnx!

some info:

debian
compiled freeradius 1.1.1 with mysql from source

Radius is working fine, i get an Acces-accept packet when i radtest a user
from the users file

radius:/var/log/radius# radtest yves test localhost 1812 testing123
Sending Access-Request of id 213 to 127.0.0.1 port 1812
        User-Name = "yves"
        User-Password = "test"
        NAS-IP-Address = 255.255.255.255
        NAS-Port = 1812
rad_recv: Access-Accept packet from host 127.0.0.1:1812, id=213, length=20
radius:/var/log/radius#

I edited /usr/local/etc/raddb/radiusd.conf to make it talk to mysql,
followed this howto:
http://www.frontios.com/freeradius.html

I've created some testusers in de mysql database as well (sorry for layout,
pasting from the shell)

mysql> connect radius
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Connection id:    61
Current database: radius

mysql> select * from usergroup;
+----------+-----------+----------+
| UserName | GroupName | priority |
+----------+-----------+----------+
|          | general   |        1 |
| steve    | general   |        1 |
| maureen  | general   |        1 |
| john     | general   |        1 |
+----------+-----------+----------+
4 rows in set (0.00 sec)

mysql> select * from radcheck;
+----+----------+---------------+----+------------------------------------+
| id | UserName | Attribute     | op | Value                              |
+----+----------+---------------+----+------------------------------------+
|  1 | steve    | User-Password | := | $1$nyiGAEuR$5wcFr5bT7SfkVjIChnbZo0 |
|  2 | maureen  | User-Password | := | $1$LTvKoOtc$X2fVg8uDqyP4.mU.iLNKm0 |
|  3 | john     | User-Password | := | $1$bkW9WNor$tq5sRRiUcwOV4/fwk3CYM/ |
+----+----------+---------------+----+------------------------------------+
3 rows in set (0.00 sec)



Though when i try to authenticate john (or other from de db),
i get a reject packet and i don't know why!

radius:/var/log/radius# radtest john test localhost 1812 testing123
Sending Access-Request of id 240 to 127.0.0.1 port 1812
        User-Name = "john"
        User-Password = "test"
        NAS-IP-Address = 255.255.255.255
        NAS-Port = 1812
Re-sending Access-Request of id 240 to 127.0.0.1 port 1812
        User-Name = "john"
        User-Password = "test"
        NAS-IP-Address = 255.255.255.255
        NAS-Port = 1812
rad_recv: Access-Reject packet from host 127.0.0.1:1812, id=240, length=20
radius:/var/log/radius#


a part from the debug ( radiusd -X )(to big for posting to the mailinglist,
i can post complete to personal mail if necessary)

sql: postauth_query = "INSERT into radpostauth (id, user, pass, reply, date)
values ('', '%{User-Name}', '%{User-Password:-Chap-Password}',
'%{reply:Packet-Type}', NOW())"
 sql: safe-characters =
"@abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_: /"
rlm_sql (sql): Driver rlm_sql_mysql (module rlm_sql_mysql) loaded and linked
rlm_sql (sql): Attempting to connect to root@localhost:/radius
rlm_sql (sql): starting 0
rlm_sql (sql): Attempting to connect rlm_sql_mysql #0
rlm_sql_mysql: Starting connect to MySQL server for #0
rlm_sql (sql): Connected new DB handle, #0
rlm_sql (sql): starting 1
rlm_sql (sql): Attempting to connect rlm_sql_mysql #1
rlm_sql_mysql: Starting connect to MySQL server for #1
rlm_sql (sql): Connected new DB handle, #1
rlm_sql (sql): starting 2
rlm_sql (sql): Attempting to connect rlm_sql_mysql #2
rlm_sql_mysql: Starting connect to MySQL server for #2
rlm_sql (sql): Connected new DB handle, #2
rlm_sql (sql): starting 3
rlm_sql (sql): Attempting to connect rlm_sql_mysql #3
rlm_sql_mysql: Starting connect to MySQL server for #3
rlm_sql (sql): Connected new DB handle, #3
rlm_sql (sql): starting 4
rlm_sql (sql): Attempting to connect rlm_sql_mysql #4
rlm_sql_mysql: Starting connect to MySQL server for #4
rlm_sql (sql): Connected new DB handle, #4
Module: Instantiated sql (sql)
Module: Loaded Acct-Unique-Session-Id
 acct_unique: key = "User-Name, Acct-Session-Id, NAS-IP-Address,
Client-IP-Address, NAS-Port"
Module: Instantiated acct_unique (acct_unique)
Module: Loaded detail
 detail: detailfile =
"/usr/local/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d"
 detail: detailperm = 384
 detail: dirperm = 493
 detail: locking = no
Module: Instantiated detail (detail)
Module: Loaded radutmp
 radutmp: filename = "/usr/local/var/log/radius/radutmp"
 radutmp: username = "%{User-Name}"
 radutmp: case_sensitive = yes
 radutmp: check_with_nas = yes
 radutmp: perm = 384
 radutmp: callerid = yes
Module: Instantiated radutmp (radutmp)
Listening on authentication *:1812
Listening on accounting *:1813
Ready to process requests.