How to use rewrite.called_station_id IN dynamic clients authorize section

Herwin Weststrate herwin at
Thu Mar 26 10:26:18 CET 2015

On 26-03-15 10:09, James Wood wrote:
> Thanks, I will take a look. I am able to do this via SQL purely:
> if ("%{sql: select count(*) from nas where REPLACE(REPLACE(community,
> \"-\", \"\"), \":\", \"\") =
> REPLACE(REPLACE(SUBSTRING(\"%{raw:Called-Station-Id}\",1,17),\"-\",
> \"\"), \":\", \"\")}" == 1) {
> But it's messy and just masks the issue. Also, when we insert in to
> radpostauth and radacct etc the MAC format is still wrong.
> I am sure there is a way to format the incoming raw Called-Station-Id
> in dynamic clients?

There is, check the policy rewrite_called_station_id. Keep in mind that
if you use this data to send a Packet of Disconnect to the NAS, it might
get rejected because the data is formatted differently than the NAS send
it (but this might differ between NAS implementations)

Herwin Weststrate

More information about the Freeradius-Users mailing list