Referencing a module by a ${}-Variable

Alan DeKok aland at
Thu Jan 14 14:43:44 CET 2021

On Jan 14, 2021, at 3:03 AM, freeradius-mlist-users at wrote:
> I am trying to set up a freeradius server with several mysql databases for different sets of accounts. The distinguation of the request should happen via the 'nas' table, which points to the different virtual servers.
> So, in the directory "sites-enabled" I have a file defining several virtual servers:
>    server wlan {
>      instance_name = "wlan"
>      $INCLUDE "../sites-available/instances_include"
>    }
> and within in the "instances_include" I want to refer to a separate instance of the SQL module:
>        authorize {
>                filter_username
>                filter_password
>                preprocess
>                sql_instance_${.instance_name}
>                auth_log
>        }

  That doesn't work, unfortunately.

> Is there any possibility to refer to a module by a ${} variable?

  No.  You'd need to patch the code.

  Historically we haven't allowed it, because we're not sure what the use-cases are.  But if people find it useful, it's possible to add.

  If the needs are complex, you can use a file template system.  Those are a lot more powerful, and don't require code changes in FreeRADIUS,

  Alan DeKok.

More information about the Freeradius-Users mailing list