moving from freeradius 2 to 3

Alan DeKok aland at
Wed Apr 7 14:45:53 CEST 2021

On Apr 7, 2021, at 7:09 AM, Brian Turnbow via Freeradius-Users <freeradius-users at> wrote:
> We have an outdated freeradius 2.0 setup that we are looking to upgrade to 3.0.

  Good to hear.

> The old setup has a mysql db and we have run into an issue trying to replicate the same configuration with 3.0.
> We have gotten everything installed and working but in our actual setup we use some regex expressions from the db such as
> NAS-Port-Type  =~ ^(Ethernet|Virtual|PPPoEoVLAN)$    to filter nas port types 
> or
> NAS-IP-Address	=~ ^(|||$  to filter which nas users can connect from
> In 3.0 it seems that the use of regex from a db has been removed.
> Is there a way to make it work ?

  Use unlang.  :(

> The goal
> We use different checks in different groups and assign the user to the correct group for the service he has purchased.
> If there is another way to accomplish this I am all ears.

  You can do unlang checking before running the "files" module:

	if (NAS-Port-Type =~ /Ethernet|Virtual|PPPoEoVLAN/) {
		update request {
			My-NAS-Port-Type := E_V_PPP

  And then in the DB, do:

	My-NAS-Port-Type == E_V_PPP

  You'll have to edit raddb/dictionary to add My-NAS-Port-Type as an attribute of type "string".  You can do similar things for other attributes.

  That's imperfect, but it involves minimal changes to the database contents.

   Alan DeKok.

More information about the Freeradius-Users mailing list