Multiple database and virtual server
Hi, I want to use multiple database to sort different kind of radius authentification (dialup, wireless, router login, etc). I don't know if i'm using it the right way, but I have try to run freeradius with two virtual server using two different sql instance. Those sql instance are configured the same way except for the database: one use "radius_db = radius_dialup" and the other one "radius_db = radius_login". If I load only one of those virtual server at radiusd startup (I remove sites-enabled links for one of those server), everything works fine. If I try them together, I got this error: Adding client 172.16.0.2 (gw-calma.digicom.ca, server=MT-Login-User) to clients list Failed to add duplicate client gw-calma.digicom.ca rlm_sql (sql_MT): Failed to add client 172.16.0.2 (gw-calma.digicom.ca) to clients list. Maybe there's a duplicate? Failed to load clients from SQL. The previous Virtual server client list contain: rlm_sql (sql_dialup): Read entry nasname=172.16.0.113,shortname=test,secret=secret rlm_sql (sql_dialup): Adding client 172.16.0.113 (test, server=dialup) to clients list rlm_sql (sql_dialup): Read entry nasname=172.16.0.2,shortname=calma,secret=xxxxxx rlm_sql (sql_dialup): Adding client 172.16.0.2 (calma, server=dialup) to clients list rlm_sql (sql_dialup): Read entry nasname=10.0.0.2,shortname=PowerAP-test,secret=xxxxx rlm_sql (sql_dialup): Adding client 10.0.0.2 (PowerAP-test, server=dialup) to clients list rlm_sql (sql_dialup): Read entry nasname=10.10.0.5,shortname=395scott,secret=xxxxxx rlm_sql (sql_dialup): Adding client 10.10.0.5 (395scott, server=dialup) to clients list rlm_sql (sql_dialup): Read entry nasname=172.16.0.237,shortname=calma2,secret=xxxxxx rlm_sql (sql_dialup): Adding client 172.16.0.237 (calma2, server=dialup) to clients list Doesn't each virtual server had his own clients list ? Why duplicate entry ? How can I force freeradius to use one client list per virtual server taken from SQL table ? Regards, Michael Plourde
Michael Plourde wrote:
I want to use multiple database to sort different kind of radius authentification (dialup, wireless, router login, etc). I don't know if i'm using it the right way, but I have try to run freeradius with two virtual server using two different sql instance. Those sql instance are configured the same way except for the database: one use "radius_db = radius_dialup" and the other one "radius_db = radius_login".
You don't have to do that. You can use one SQL instance, and change the radius_db on the fly. But for now, it's likely good enough.
If I load only one of those virtual server at radiusd startup (I remove sites-enabled links for one of those server), everything works fine. If I try them together, I got this error:
Adding client 172.16.0.2 (gw-calma.digicom.ca, server=MT-Login-User) to clients list Failed to add duplicate client gw-calma.digicom.ca rlm_sql (sql_MT): Failed to add client 172.16.0.2 (gw-calma.digicom.ca) to clients list. Maybe there's a duplicate? Failed to load clients from SQL. ... Doesn't each virtual server had his own clients list ? Why duplicate entry ? How can I force freeradius to use one client list per virtual server taken from SQL table ?
See the sample SQL queries && schema. 2.1.1 allows you to define a "server" column. That entry is used to associate one client with a particular server. Alan DeKok.
Michael Plourde wrote:
I want to use multiple database to sort different kind of radius authentification (dialup, wireless, router login, etc). I don't know if i'm using it the right way, but I have try to run freeradius with two virtual server using two different sql instance. Those sql instance are configured the same way except for the database: one use "radius_db = radius_dialup" and the other one "radius_db = radius_login".
You don't have to do that. You can use one SQL instance, and change the radius_db on the fly. But for now, it's likely good enough.
How can I change radius_db on the fly ?
If I load only one of those virtual server at radiusd startup (I remove sites-enabled links for one
of
those server), everything works fine. If I try them together, I got this error:
Adding client 172.16.0.2 (gw-calma.digicom.ca, server=MT-Login-User) to clients list Failed to add duplicate client gw-calma.digicom.ca rlm_sql (sql_MT): Failed to add client 172.16.0.2 (gw-calma.digicom.ca) to clients list. Maybe there's a duplicate? Failed to load clients from SQL. ... Doesn't each virtual server had his own clients list ? Why duplicate entry ? How can I force freeradius to use one client list per virtual server taken from SQL table ?
See the sample SQL queries && schema. 2.1.1 allows you to define a "server" column. That entry is used to associate one client with a particular server.
That already done as I said upper:
Adding client 172.16.0.2 (gw-calma.digicom.ca, server=MT-Login-User) to clients list but even with server specify I've got this error with Freeradius 2.1.0.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
-- Internal Virus Database is out-of-date. Checked by AVG. Version: 7.5.549 / Virus Database: 270.8.5/1758 - Release Date: 2008-10-31 08:22
Thank you for your help, Michael Plourde
Michael Plourde wrote:
You don't have to do that. You can use one SQL instance, and change the radius_db on the fly. But for now, it's likely good enough.
How can I change radius_db on the fly ?
It's just another piece of text in a configuration file. Edit it to something like: radius_db = %{control:Foo-Bar-Baz} Edit raddb/dictionary to add the attribute Foo-Bar-Baz (with a name that makes sense). Follow the instructions there for picking numbers, etc. Once that's done, just set it at the top of the "authorize" and "preacct" sections in the virtual servers: update control { Foo-Bar-Baz = "database-name-1" } Or "database-name-2". That will work.
See the sample SQL queries && schema. 2.1.1 allows you to define a "server" column. That entry is used to associate one client with a particular server.
That already done as I said upper:
Hmm... it *should* work. I haven't spent much time with that portion of the code, though. Alan DeKok.
participants (2)
-
Alan DeKok -
Michael Plourde