I would like to have redundant SQL modules (that point to 2 different databases that are kept in sync using SQL replication) for the purpose of reading clients at startup and for the dynamic_clients virtual server. I don't use SQL for any other purpose. I've tried some things and done some searching and, so far, I haven't gotten anything to work. (I do have readclients=yes, dynamic_clients and Huntgrouop-Name lookup working for one SQL server and I believe I know how to get dynamic Huntgroup-Name working for more than one SQL server using unlang, but I'd like readclients/dynamic_clients to try a 2nd server if the first fails.) Is this possible without code changes?
Garber, Neal wrote:
I would like to have redundant SQL modules (that point to 2 different databases that are kept in sync using SQL replication) for the purpose of reading clients at startup and for the dynamic_clients virtual server. I don’t use SQL for any other purpose. I’ve tried some things and done some searching and, so far, I haven’t gotten anything to work. (I do have readclients=yes, dynamic_clients and Huntgrouop-Name lookup working for one SQL server and I believe I know how to get dynamic Huntgroup-Name working for more than one SQL server using unlang, but I’d like readclients/dynamic_clients to try a 2^nd server if the first fails.)
Is this possible without code changes?
Maybe you should use mysql clustering instead? -- Best regards, Denis Volkov
Garber, Neal wrote:
I would like to have redundant SQL modules (that point to 2 different databases that are kept in sync using SQL replication) for the purpose of reading clients at startup and for the dynamic_clients virtual server. I don’t use SQL for any other purpose. I’ve tried some things and done some searching and, so far, I haven’t gotten anything to work.
? Configure both modules: modules { ... sql sql1 { ... } sql sql2 { ... } } And then list them both in the "instantiate" section to get them to load the clients: instantiate { ... sql1 sq12 } Then in the virtual server for the dynamic client, list them in a redundant section: redundant { sql1 sql2 }
(I do have readclients=yes, dynamic_clients and Huntgrouop-Name lookup working for one SQL server and I believe I know how to get dynamic Huntgroup-Name working for more than one SQL server using unlang, but I’d like readclients/dynamic_clients to try a 2^nd server if the first fails.)
Try the above config. It should work.
Is this possible without code changes?
Absolutely. Alan DeKok.
Thank you so much for your time Alan.
Configure both modules:
Yup - I did that..
And then list them both in the "instantiate" section
Yup - I eventually did that too.. My concern is that if I list 2 sql instances and both have readclients=yes and either one is down, then FR won't start. I read another thread about this and it didn't seem like there was a way around this currently. I would be willing to create an enhancement if you think it's a reasonable thing to do and if you would entertain the possibility of accepting the patch. If so, and you'd like to provide some guidance on how you'd like to see it implemented, let me know. Or, I can propose something and ask for your feedback if you'd prefer.
Then in the virtual server for the dynamic client, list them in a redundant section:
Ugh - I had redundant in the instantiate. One more thing.. I'm having trouble getting redundancy to work in the dynamic client virtual server: authorize { redundant sqlha { sqlaugs sqlroch } if ("%{sqlha: SELECT nasname FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}") { update control { FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}" FreeRADIUS-Client-Shortname = "%{sqlha: SELECT shortname FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}" FreeRADIUS-Client-Secret = "%{sqlha: SELECT secret FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}" FreeRADIUS-Client-NAS-Type = "%{sqlha: SELECT type FROM nas WHERE nasname = '%{Packet-Src-IP-Address}'}" } } } Note: query lines are split above for readability - they are not split in the config. I've tried sqlha as a prefix, as shown above, which I now know is wrong because it has no xlate capability (if I'm reading the code correctly). I also tried sqlroch and sqlaugs as a prefix. If I use a prefix of a database that is down, then it never tries the 2nd choice for the assignment stmts (it does try the 2nd choice for the if stmt). If I use the prefix of a database that is up, it works fine for assignment and if stmts. I attached the debug output for all 3 tests. For all 3 tests, sqlroch was up and sqlaugs was down. Am I doing something wrong or is this a bug? I thought about using an else block that uses the other sql module as a prefix; but, if that's needed, then what is the purpose of redundant? Thanks again for your help.
Garber, Neal wrote:
Yup - I eventually did that too.. My concern is that if I list 2 sql instances and both have readclients=yes and either one is down, then FR won't start.
That is an issue which could likely be fixed in a future release.
I read another thread about this and it didn't seem like there was a way around this currently. I would be willing to create an enhancement if you think it's a reasonable thing to do and if you would entertain the possibility of accepting the patch. If so, and you'd like to provide some guidance on how you'd like to see it implemented, let me know. Or, I can propose something and ask for your feedback if you'd prefer.
Source code patched.
One more thing.. I'm having trouble getting redundancy to work in the dynamic client virtual server:
authorize { redundant sqlha { sqlaugs sqlroch }
if ("%{sqlha: SELECT nasname FROM nas
That doesn't work. The expansion %{...} applies ONLY to modules, and a redundant section isn't a module.
Am I doing something wrong or is this a bug? I thought about using an else block that uses the other sql module as a prefix; but, if that's needed, then what is the purpose of redundant?
It depends on what you need. The redundant sections work just fine for normal queries to radcheck && radreply. If you're doing %{...}, then the redundant sections don't apply. Alan DeKok.
Hi, We're having a bit of a problem with FreeRADIUS not always including VLAN information in access-accept packets; I've not been able as yet to establish what the cause is so I thought I'd throw it out to the list if there's something others have come across. Needless to say our testing through the summer had not highlighted this issue, but now we have 3000 students trying to connect it's become apparent. A bit of info, we're seeing this issue in both FR 2.1.1 and 2.1.7, and our NASes are Cisco WiSM. Users' VLAN info is stored in the SQL usergroup table. I have an sql.athorize statement in the Post-Auth section of both the default (outer), and inner-tunnel conf files. Initially I thought it was only clients with an anonymised outer identity that were having this issue, which seemed plausible as the sql.athourize in default would see the outer and fail to find it in sql (though wouldn't explain why it works sometimes); but it appears not to just these users, as we're now seeing users who are not using anon outers having the same issue. Another thought was that fast-reauth could be the issue, in that somehow a fast-reauth request was not doing a Post-Auth sql.authorize and therefore not sending back the VLAN info? I fully expect it's a config issue, but any insight would be gratefully received. Currently I do not have CCKM enabled on the controllers, but for some time I have been considering enabling this to take some load off RADIUS, and also wondered if it would help this current problem. Is there anything to be wary of with CCKM? Many thanks, Jezz Palmer.
Source code patched.
Thanks..
The redundant sections work just fine for normal queries to radcheck && radreply. If you're doing %{...}, then the redundant sections don't apply.
Ah, now I understand. I abandoned redundant and used if/elsif instead in my dynamic_client virtual server: if ("%{sqlaugs: SELECT ...}'}") { update control { FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}" FreeRADIUS-Client-Shortname = "%{sqlaugs: SELECT ...}'}" FreeRADIUS-Client-Secret = "%{sqlaugs: SELECT ...}'}" FreeRADIUS-Client-NAS-Type = "%{sqlaugs: SELECT ...}'}" } } elsif ("%{sqlroch: SELECT ...}'}") { update control { FreeRADIUS-Client-IP-Address = "%{Packet-Src-IP-Address}" FreeRADIUS-Client-Shortname = "%{sqlroch: SELECT ...}'}" FreeRADIUS-Client-Secret = "%{sqlroch: SELECT ...}'}" FreeRADIUS-Client-NAS-Type = "%{sqlroch: SELECT ...}'}" } } This works great. Thanks again for your help Alan..
participants (4)
-
Alan DeKok -
Garber, Neal -
Palmer J.D.F. -
volkov@ufamts.ru