radwho Calling-Station-Id

Roman romeo.r at gmail.com
Tue May 9 13:39:29 CEST 2017


2017-05-09 12:27 GMT+03:00 Matthew Newton <mcn4 at leicester.ac.uk>:

> The structure in radutmp for Calling-Station-Id is only 16 chars
> long including trailing zero, so that figures.
>
> You probably just want to use a proper database these days. But if
> you really want to keep using radutmp then use unlang to strip the
> colons out.
>
> Matthew
>
> Thanks for pointing out!
adding this to /etc/freeradius/policy.d/canonicalization solved the issue!

rewrite_called_station_id-pppoe {
         if(Calling-Station-Id =~
/^([0-9a-f]{2})([:-])([0-9a-f]{2})([:-])([0-9a-f]{2})([:-])([0-9a-f]{2})([:-])([0-9a-f]{2})([:-])([0-9a-f]{2})$/i){
                update request {
                         Calling-Station-Id := "%{1}%{3}%{5}%{7}%{9}%{11}"
                }
        }
        else {
                noop
        }
}

and then added rewrite_called_station_id-pppoe to both authorize and
preacct sections of  /etc/freeradius/sites-enabled/default

now it looks somewhat acceptable:
Calling-Station-Id = "00A0C53F132D"


-- 
Best regards,
Roman.


More information about the Freeradius-Users mailing list