Multiple Customer Databases

Oliver Kutscher ok at addix.net
Mon Jul 25 16:38:10 CEST 2016


Hi,

I'm using freeradius 3.0.4 on a Red Hat Centos 7 and it seems I missed a 
fundamental point.

I have several customers with their own database. I do logging 
accounting data to sql. My problem is that any accounting data of any 
customers is logged to any radacct tables. E.g. accounting data of 
customer1 is logged to (sql) customer1.radacct, but also to 
customer2.radacct and vise versa.

/etc/raddb/mods-enabled/sql:

sql customer1 {
         driver = "rlm_sql_mysql"
         dialect = "mysql"
         server = "localhost"
         port = 3306
         login = "radius"
         password = "ffgfdfdgfdgdg"
         radius_db = "customer1"
         acct_table1 = "radacct"
         acct_table2 = "radacct"
         postauth_table = "radpostauth"
         authcheck_table = "radcheck"
         groupcheck_table = "radgroupcheck"
         authreply_table = "radreply"
         groupreply_table = "radgroupreply"
         usergroup_table = "radusergroup"
         delete_stale_sessions = yes
         pool {
                 start = 5
                 min = 4
                 max = ${thread[pool].max_servers}
                 spare = 3
                 uses = 0
                 lifetime = 0
                 idle_timeout = 60
         }
         read_clients = yes
         client_table = "nas"
         $INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
}

sql customer2 {
         driver = "rlm_sql_mysql"
         dialect = "mysql"
         server = "localhost"
         port = 3306
         login = "radius"
         password = "fgfdgdg"
         radius_db = "customer2"
         acct_table1 = "radacct"
         acct_table2 = "radacct"
         postauth_table = "radpostauth"
         authcheck_table = "radcheck"
         groupcheck_table = "radgroupcheck"
         authreply_table = "radreply"
         groupreply_table = "radgroupreply"
         usergroup_table = "radusergroup"
         delete_stale_sessions = yes
         pool {
                 start = 5
                 min = 4
                 max = ${thread[pool].max_servers}
                 spare = 3
                 uses = 0
                 lifetime = 0
                 idle_timeout = 60
         }
         read_clients = yes
         client_table = "nas"
         $INCLUDE ${modconfdir}/${.:name}/main/${dialect}/queries.conf
}

...

/etc/raddb/sites-enabled/default:

[..]

accounting {
..
	customer1
	customer2
..
}


Any help would be appreciated.

--
MrLINK


More information about the Freeradius-Users mailing list