policy in fr 3

Andrés Gómez andres.gomez.ruiz at gmail.com
Sat Dec 29 21:12:25 CET 2018


Hi dear list.

I will migrate an old freeradius server v2.x o the lastest v 3.0.17.
REading the documentation about I see that the file policy.conf that I use
in v2 to rewrite the calledstationid in accounting, in not used in v3.

In old v2, I have this policy:

        rewrite.called_station_id {
                if((Called-Station-Id) && "%{Called-Station-Id}" =~
/^%{config:policy.mac-addr}(:(.+))?$/i) {
                        update request {
                                Called-Station-Id :=
"%{tolower:%{1}%{2}%{3}%{4}%{5}%{6}}"
                        }

                        # SSID component?
                        if ("%{8}") {
                                update request {
                                        Called-Station-Id :=
"%{Called-Station-Id}"
                                }
                        }
                        updated
                }
                else {
                        update request {
                                Called-Station-Id :=
"%{tolower:%{Called-Station-Id}}"
                        }
                }
        }

then I enable it in sites-availables/default:

authorize {
        rewrite.called_station_id
        rewrite.calling_station_id
...
}

How can I do this in v3.0.x?

Best regards!!

-- 
*C. Andrés Gómez R.*


More information about the Freeradius-Users mailing list