best place for logic - users file or custom module?
hi, i'm planning a significant migration from a different radius server (Radiator, perl based). one advantage of that server is that it is very easy to code custom hooks to apply business logic to post-(ldap)-search and post-auth points of the radius sequence. the disadvantage is the performance of the system (single-threaded, low peak performance intorducing latency into system). our tests with freeradius show a much lighter server - its faster, and easier on memory and cpu. however the downside is that applying custom logic to the radius process is a bit more difficult. i'd like some advide on the best place to implement this logic. for example - a common scenario is for a request to come from A, and the reply to A contains instructions to extend a tunnel to a second device B. A second query from B is then received. this case is handled easily in perl using "if()" constructs. in theory - and for simple cases - i can do this in the "users" file with the matching conditions to provide the logic - but that's not a scalable or sensible way i think - correct me if i'm wrong. i'll be handling many conditions (if nas-identifier = x, .., if domain/realm = y ... ). so i guess i have to write a custom module for this? comments appreciated. pointers to examples / tutorials also appreciated - i couldn't find any in the documentation or on the website. tariq
Tariq Rashid wrote:
hi, i'm planning a significant migration from a different radius server (Radiator, perl based).
You might have a look at the rlm_perl module (persistent perl module to intervene in multiple stages). It's not marked stable yet, but it should be soon and it should be working fine already. There's a sample script included in the source distribution in src/module/rlm_perl/ The configuration of the module sits in etc/raddb/experimental.conf for now. -- Groeten, Regards, Salutations, Thor Spruyt M: +32 (0)475 67 22 65 E: thor.spruyt@telenet.be W: www.thor-spruyt.com www.salesguide.be www.telenethotspot.be
Tariq Rashid <tariq.rashid@uk.easynet.net> wrote:
hi, i'm planning a significant migration from a different radius server (Radiator, perl based).
That's good to hear!
our tests with freeradius show a much lighter server - its faster, and easier on memory and cpu. however the downside is that applying custom logic to the radius process is a bit more difficult.
Yes, there are trade-offs.
i'd like some advide on the best place to implement this logic. for example - a common scenario is for a request to come from A, and the reply to A contains instructions to extend a tunnel to a second device B. A second query from B is then received.
this case is handled easily in perl using "if()" constructs.
My suggestion is to use Perl. :) rlm_perl is in 1.0.4, but it's not stable. The CVS head is in transition, too. I would suggest grabbing revision 1.19 of rlm_perl from CVS, and building it into 1.0.4. It should work, and it will get you the custom logic you need. And, it will be multi-threaded, too. Alan DeKok.
Tariq Rashid wrote:
i'd like some advide on the best place to implement this logic. for example - a common scenario is for a request to come from A, and the reply to A contains instructions to extend a tunnel to a second device B. A second query from B is then received.
Use huntgroups to distinguish the NASes, and edit the SQL schema and the SQL queries to use the Huntgroup-Name. Then you could get different reply attributes for "A" and for "B" from SQL with no overhead. -- Nicolas Baradakis
participants (4)
-
Alan DeKok -
Nicolas Baradakis -
Tariq Rashid -
Thor Spruyt