Freeradius with Caller-station-id

Fajar A. Nugraha list at fajar.net
Thu Feb 16 05:46:25 CET 2012


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'"
    ...
}

-- 
Fajar




More information about the Freeradius-Users mailing list