Freeradius with Caller-station-id
Joe Holden
lists at rewt.org.uk
Thu Feb 16 05:49:05 CET 2012
On 16/02/2012 04:46, Fajar A. Nugraha wrote:
> On Thu, Feb 16, 2012 at 11:42 AM, Joe Holden<lists at rewt.org.uk> wrote:
>> On 16/02/2012 04:39, Fajar A. Nugraha wrote:
>>> On Thu, Feb 16, 2012 at 11:37 AM, Joe Holden<lists at rewt.org.uk> wrote:
>>>> Using the Auth-Type method does work, but as the username is the lookup
>>>> key,
>>>> it doesn't provide the ability to deliver attributes to the NAS (from
>>>> what
>>>> I can see),
>>> Sure it does.
>>>
>>> update reply {
>>> your-attribute-name := your-attribute-value
>>> ...
>>> }
>>>
>> How will that work if for example all my attributes are in a database and
>> are per user?
>> There is essentially *no* username for these sessions, so how does FR lookup
>> the correct records without replacing the username before?
> That depends on your needs, obviously.
>
> If you need per-user attributes, then yes, the easiest way is probably
> to just change the value of username.
>
> However, if you give out the SAME attribute to all users, then unlang
> is cleaner. Or if you have only several (e.g. one) unique attribute
> per user, you can also just get that attribute using unlang, e.g.
>
> update reply {
> your-attribute-name := "%{sql: SELECT value FROM radreply WHERE
> username='%{Calling-Station-Id}' AND attribute='your-attribute-name'"
> ...
> }
>
That is rather cute, although being able to treat the incoming session
calling station id as the username scales better, as then the phone
numbers can be treated as users just like any other typical user at domain
scenario
Thanks for the pointers though, will definitely come in handy
Thanks,
J
More information about the Freeradius-Users
mailing list