perl examples

Alex Sharaz alex.sharaz at york.ac.uk
Mon Apr 8 15:20:09 CEST 2013


Magic! 

many thanks, got all the bits I needed 

One question though, 

Why auth and not post-auth? I'm working on the basis that the stuff I do doesn't have anything to do with the actual auth process, in post-auth I'm doing things like setting session-timeouts. vlan assignments  etc. based upon whether it's an access-request or an access-reject.

Is there something wrong with that logic?

Rgds
alex



On 8 Apr 2013, at 14:10, Alex Sharaz <alex.sharaz at york.ac.uk> wrote:

> 
> On 8 Apr 2013, at 13:32, A.L.M.Buxey at lboro.ac.uk wrote:
> 
>> Hi,
>> 
>>> There don't seem to be many examples relating to using  perl to access remote databases…. in fact there don't seem to be many perl examples at all.
>> 
>> thats because its a PERL issue not a FreeRADIUS one :-)
>> 
> 
> :-)) 
> 
> but its perl being used within Freeradius (he says batting the ball over the net ) 
> 
>>> In post-auth I want to 
>>> 
>>> extract the nas-ip address and calling station-id of the client device
>>> open a db connection and perform a query that'll let me  decide what vlan-id to send back in the access-accept packet
>>> write radius attributes into the access-accept reply
>> 
>> you need to use DBI PERL to open the connection and then create the query.
>> for the query you can use values straight from the FreeRADIUS PERL hook - or assign
>> them to variables and use those variables, then run the query and look at
>> the results.  of course, you will need to verify that the connection was okay,
>> that the query was okay and that the results are okay. 
>> 
> o.k. can do much of that. \
> 
>>> Anyone got some form of template I could use for the above?
>> 
>> each case requires new code....but a quick Google will show you how to do the DB query
>> stuff...I can provide you some templte for assigning variables 
> That would be great if you could
> Rgds
> Alex
> 
>> 
>> alan
>> -
>> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
> 



More information about the Freeradius-Users mailing list