External, non-RADIUS databases

J Kephart jkephart at safetynetaccess.com
Tue Oct 11 16:59:35 CEST 2016


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 at 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!


More information about the Freeradius-Users mailing list