Re: rewriting usernames



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@<some-isp.com> 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}@some-isp.com"

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

Kevin Bonner

Attachment: pgpM1He1K60Xj.pgp
Description: PGP signature



This archive was generated by a fusion of Pipermail (Mailman edition) and MHonArc.