usage of exec to get LDAP value..
Dear all, I've configured my radius to load value of timeout based on NAS-Port-Type.. Using LDAP for user's entry.. In LDAP.. user's entry will have additional 2 attributes TimeoutPSTN: 4000 TimeoutISDN: 1000 then in users file.. using exec to run small script to get correct value of sessiontimeout based on NAS-Port-Type DEFAULT NAS-Port-Type == "Sync", Autz-Type := DIALUP, Auth-Type := DIALUP Session-Timeout = `%{exec:/usr/local/etc/raddb/timeout.pl %U ISDN}` DEFAULT NAS-Port-Type == "Async", Autz-Type := DIALUP, Auth-Type := DIALUP Session-Timeout = `%{exec:/usr/local/etc/raddb/timeout.pl %U PSTN}` And its works... But my question is there any better way to do this?? Maybe directly get value from LDAP.... thanks.. --haizam
"haizam" <haizam@myjaring.net> wrote:
In LDAP.. user's entry will have additional 2 attributes
TimeoutPSTN: 4000 TimeoutISDN: 1000
then in users file.. using exec to run small script to get correct value of sessiontimeout based on NAS-Port-Type
See raddb/ldap.attrmap You can map those attributes to Session-Timeout, I think. If that doesn't work, map them to new attributes, and use the "users" file to copy those attributes to Session-Timeout. Alan DeKok.
Alan, I've tried to map new attributes in ldap.attrmap but for every match in users file.. it will return both new attributes but the sessiontimeout still ruturn no value.. So at the moment i stick to use "exec" to run external script.... unless somebody can suggest better way to do it.. thanks.. --haizam ----- Original Message ----- From: "Alan DeKok" <aland@ox.org> To: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Sent: Thursday, August 25, 2005 23:30 Subject: Re: usage of exec to get LDAP value..
"haizam" <haizam@myjaring.net> wrote:
In LDAP.. user's entry will have additional 2 attributes
TimeoutPSTN: 4000 TimeoutISDN: 1000
then in users file.. using exec to run small script to get correct value of sessiontimeout based on NAS-Port-Type
See raddb/ldap.attrmap You can map those attributes to Session-Timeout, I think.
If that doesn't work, map them to new attributes, and use the "users" file to copy those attributes to Session-Timeout.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
I just add in /usr/local/etc/raddb/dictionary as below:- ATTRIBUTE Haizam-PSTN 3003 integer ATTRIBUTE Haizam-ISDN 3004 integer and in ldap.attrmap replyItem Haizam-PSTN TimeoutPSTN replyItem Haizam-ISDN TimeoutISDN But problem with assigned those value to Session-Timeout... Is below users entry correct? DEFAULT NAS-Port-Type == "Sync", Autz-Type := DIALUP, Auth-Type := DIALUP Session-Timeout = %{Haizam-ISDN} --haizam ----- Original Message ----- From: "Alan DeKok" <aland@ox.org> To: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Sent: Saturday, August 27, 2005 07:44 Subject: Re: usage of exec to get LDAP value..
"haizam" <haizam@myjaring.net> wrote:
I've tried to map new attributes in ldap.attrmap but for every match in users file.. it will return both new attributes but the sessiontimeout still ruturn no value..
Yes. Did you read the rest of my response?
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (2)
-
Alan DeKok -
haizam