Variable expansion for SQL attributes

Javier Matos Odut javiermatos at
Fri Dec 9 15:24:35 CET 2016


I have FreeRADIUS running with a sql database in production. I am using the
sql database to set user's check and reply attributes. The problem I have
is that there are some attributes that I need to set them at runtime
depending on the NAS identity (or any other FreeRADIUS variable), so I have
to edit the configuration file and add something like this:

if (...) {
  update control {
    Pool-Name := "%{NAS-Identifier}"

Please, ignore the fact that I am updating the Pool-Name attribute. It is
just an example but it has sense in my case to let users switch between NAS
and IP pools automatically.

I want to be able to use variables in attributes column (for radcheck,
radreply, radgroupcheck, and radgroupreply tables). Then FreeRADIUS will
get those values for attributes and expand or evaluate them replacing
variable placeholders for concrete values. I don't want to modify the
configuration file to store any user's configuration as I am currently

Will that feature make sense? I can help in programming it or even make a
donation to have someone help me in doing this.

I post a request on Github:

I was suggested to use SQL xlat expansion %{sql:SELECT ...} but that is not
useful in my case because I don't want to customize requests.


More information about the Freeradius-Users mailing list