rewriting usernames

Kevin Bonner keb at
Tue Nov 14 23:58:50 CET 2006

On Monday 13 November 2006 22:24, Christopher Carver wrote:
> Hello,
> How do I rewrite the value of the User-Name attribute based on
> Called-Station-Id?  I need to do a series of these logical decisions and
> replace the username with username@<> based on what the value
> of Called-Station-Id is.
> rlm_attr_rewrite seems the obvious choice, but I can't figure out how to
> use various instances of that module only when Called-Station-Id has a
> certain value.
> It seems like a strange thing to need to do, but I've thought about our
> problem and this is really the only scalable way.  I can give a lot of
> background as to why, but I figured I would ask the question first.  So,
> does anyone have any ideas?
> Also, thank you for all the hard work on Freeradius.  Its a great piece of
> software.
> Thanks
> Chris Carver

Not a crazy question at all.  We used a hints file entry like:

DEFAULT Called-Station-Id =~ "^(012)?3456789$"
        User-Name := "%{User-Name}"

After that, it's pretty easy.  Just make sure the realm is in 
proxy.conf and it should act like any other normal request.

Kevin Bonner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the Freeradius-Users mailing list