Modify NAS-Port-Id value in mysql

Alan DeKok aland at
Tue Dec 7 22:11:47 CET 2021

On Dec 7, 2021, at 3:44 PM, Yannick Champs <ychamps at> wrote:
> how can I modify NAS-Port-Id attribute value (truncate string operation)
> before it gets recorded in MySQL database.

  You use "unlang" to edit it before the "sql" module is run.

> I've read about ulang and understand that /etc/raddb/sites-enabled/default
> file should be modified.
> which section "post-auth", "preacct", "accounting" should I modify ?

  It depends where you're running the SQL module.

  Run the server in debug mode, and it will show you what it's doing.  See where it's running "sql", and then edit that section of the configuration files.

  All of this is printed out for a reason: so you can easily see what's going on, and which parts of the configuration are being run.

> Is there another way to do it ?

  No.  You have to write local "unlang" policies to do whatever local editing you want to do.

  Alan DeKok.

More information about the Freeradius-Users mailing list