External, non-RADIUS databases
I have two different FR deployments, one running a MySQL database, the other Postgres. Those are working as they should. The requirement we have is that, on each of them, we need to be able to connect a captive portal server so that we can query a non-radius database for a specific boolean value that will determine whether or not radius will execute a set of instructions. Is the process for this as simple as defining the main (radius) instance, and then a second instance for the external database (e.g., sql sqlinstance1 { ... }, sql sqlinstance2 { ... }), with the appropriate connection information for both, and then changing the sql stuff in auth... and accounting sections to use sqlinstance1 for radius queries, and sqlinstance2 for the external database? If I'm reading the docs on rlm_mysql correctly, I'm thinking it is, but I just want to confirm it, as we've not done anything beyond a basic deployment as yet. Thanks for any advice! Jim
Yes you are doing it in a correct way. You can also avoid users from captive to not able to connect to non captive ssid by using sql. If (called-station-id =~ /ssid-1/) { Sqlinstance1 } .... and so on On Tuesday 11 October 2016, J Kephart <jkephart@safetynetaccess.com> wrote:
I have two different FR deployments, one running a MySQL database, the other Postgres. Those are working as they should. The requirement we have is that, on each of them, we need to be able to connect a captive portal server so that we can query a non-radius database for a specific boolean value that will determine whether or not radius will execute a set of instructions.
Is the process for this as simple as defining the main (radius) instance, and then a second instance for the external database (e.g., sql sqlinstance1 { ... }, sql sqlinstance2 { ... }), with the appropriate connection information for both, and then changing the sql stuff in auth... and accounting sections to use sqlinstance1 for radius queries, and sqlinstance2 for the external database? If I'm reading the docs on rlm_mysql correctly, I'm thinking it is, but I just want to confirm it, as we've not done anything beyond a basic deployment as yet.
Thanks for any advice!
Jim - List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
-- BR, Anirudh Malhotra Mail: 8zero2.in@gmail.com Facebook: www.facebook.com/8zero2 Twitter: @8zero2_in Blog: blog.8zero2.in
On 10/11/2016 03:21 AM, Anirudh Malhotra wrote:
Yes you are doing it in a correct way. You can also avoid users from captive to not able to connect to non captive ssid by using sql. If (called-station-id =~ /ssid-1/) { Sqlinstance1 } .... and so on
On Tuesday 11 October 2016, J Kephart <jkephart@safetynetaccess.com> wrote:
Is the process for this as simple as defining the main (radius) instance, and then a second instance for the external database (e.g., sql sqlinstance1 { ... }, sql sqlinstance2 { ... }), with the appropriate connection information for both, and then changing the sql stuff in auth... and accounting sections to use sqlinstance1 for radius queries, and sqlinstance2 for the external database? If I'm reading the docs on rlm_mysql correctly, I'm thinking it is, but I just want to confirm it, as we've not done anything beyond a basic deployment as yet.
Well, hmph, that's not working. For some reason, radius is not instantiating the second SQL instance, and 'radiusd -X' doesn't show that it even *sees* the second instance (the first, standard radius instance loads correctly). The only indication that I've even got it configured is when radius logs this: WARNING: Unknown module "sql_instance2" in string expansion "%". I've only configured a minimal instance for the second one, so sql.conf looks like this: sql sql_instance1 { ... } sql sql_instance2 { database = "mysql" driver = "rlm_sql_${database}" server = "myserver" port = 3306 login = "myuser" password = "mypassword" # Database table configuration for everything except Oracle radius_db = "mydb" } radius lookups are all successful using sql_instance1, so that's working. However, when the query I want to execute against the external database is called, radius reports "WARNING: Unknown module 'sql_instance2' in string expansion '%'." There's something definitely wrong, but the debug output doesn't tell me what it is, so I am at a loss as to what is happening and how to fix it. Can someone point me in the right direction? Thanks!
On 10/11/2016 05:57 PM, A.L.M.Buxey@lboro.ac.uk wrote:
Hi,
Well, hmph, that's not working. For some reason, radius is not instantiating Now I know why: sql_instance2 wasn't listed in the instantiate section of radiusd.conf. Everything works as it should now. you dont get that problem in 3.x
alan - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Thanks, Alan. That's good to know.
participants (3)
-
A.L.M.Buxey@lboro.ac.uk -
Anirudh Malhotra -
J Kephart