new table and query

Johansson, Daniel (GIS) Daniel.Johansson2 at sony.com
Thu Aug 31 08:46:21 CEST 2017


Hi
I use FreeRADIUS Version 2.2.6
I want to make a custom table and query for freeradius.
sql is enabled in sites-enabled/default for 'post-auth {sql}'
and postauth_query is populating radpostauth However my 'macuseradd_query ' is not run can anyone tell me why?

I have inserted a new table to my mysql for radius 'authorizedmacs'.
mysql> show tables;
+------------------+
| Tables_in_radius |
+------------------+
| authorizedmacs   |
| radacct          |
| radcheck         |
| radgroupcheck    |
| radgroupreply    |
| radpostauth      |
| radreply         |
| radusergroup     |
+------------------+

mysql> describe authorizedmacs;
+------------+----------------------+------+-----+-------------------+-----------------------------+
| Field      | Type                 | Null | Key | Default           | Extra                       |
+------------+----------------------+------+-----+-------------------+-----------------------------+
| id         | smallint(5) unsigned | NO   | PRI | NULL              | auto_increment              |
| macaddress | varchar(12)          | NO   | MUL | NULL              |                             |
| created    | timestamp            | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+------------+----------------------+------+-----+-------------------+-----------------------------+

I also added a entry in sql.conf
        macauth_table = "authorizedmacs"
Then I created query in dailup.conf 'macuseradd_query '

        #######################################################################
        # Authentication Logging Queries
        #######################################################################
        # postauth_query                - Insert some info after authentication
        #######################################################################

        postauth_query = "INSERT INTO ${postauth_table} \
                          (username, pass, reply, authdate) \
                          VALUES ( \
                          '%{User-Name}', \
                          '%{%{User-Password}:-%{Chap-Password}}', \
                          '%{reply:Packet-Type}', '%S')"

        macuseradd_query = "INSERT INTO ${macauth_table} \
                                 (macaddress) \
                                VALUES ( \
                                '%{Calling-Station-Id}')"

It would be much appreciated if anyone can tell me why macuseradd_query isn’t run as postauth_query is.

BR
/Daniel




More information about the Freeradius-Users mailing list