4 May
2012
4 May
'12
10:16 a.m.
Xbert_badstuber wrote:
Is there anything I can do in the freeradius to change the characters to different ones? Example: To make “/” as “-“ and “:” as “_”. So the NAS-Port-ID would look like “1-1-4_1001.129” instead. Is it possible to translate characters in Freeradius? If possible, how do i make it?
You can't translate the characters, but you can re-write the attribute. I'd use a regex: if (NAS-Port-Id =~ /^(.)/(.)/(.):(.*)$/) { update request { NAS-Port-Id := "%1_%2_%3_%4" } } You may have to play with the regex to get it to match your exact case, but the idea is there. Alan DeKok.