How to use rewrite.called_station_id IN dynamic clients authorize section
email.me at kevp.com
Thu Mar 26 15:47:01 CET 2015
> In normal circumstances this works beautifully, but when we have a NAS that
> sends the Called-Station-Id value as AABBCCDDEEFF with no colon or
> hyphen, auth fails, because in our SQL database we store the MAC like AA-
> BB-CC-DD-EE-FF. I already use SQL to replace colon with hyphen, but I am
> struggling with if it has no delimiter at all. For this particular NAS client, there
> is no way to change the format of the Called-Station-Id value it is sending so I
> need something on the FreeRadius side.
You could create view on your database table that gives two result columns one with dashes and one without.
Then build your freeradius check with an OR statement in it...
But personally I would normalise down to the lowest format, i.e. no delimieters at all, all the time.
Then add a view to your database that removes the dashes when selecting the MAC fields.
Then strip dashes, colons, spaces or whatever from the select that freeradius uses so you are only ever comparing at the lowest common format.
More information about the Freeradius-Users