Hi all;
 
 
I am nearly there, thanks to you all.
 
I have created this rule on the file sites-available/default on the authorize section:
 
if("%{User-Name}"){

        if ("%{User-Name}" =~ /^([^@]*)(@([-[:alnum:].]+))?$/){
                        update request {
                                User-Name := "%{1}"
                                Digest-Realm := "%{3}"
                        }
        }
        else {
                        reject
        }
}

 
I am getting the user to authenticate as "user @ MAC_ADDRESS", and the REGEX is doing what is supposed to do, but the field Realm on the radacct table is not being updated with the MAC_ADDRESS it is empty, is the Digest-Realm the right attribute to be updated for the realm?
 
Thanks
 
Lucio
 
> Date: Mon, 25 Jan 2010 17:52:35 +0100
> From: aland@deployingradius.com
> To: freeradius-users@lists.freeradius.org
> Subject: Re: Help pls: How to strip REALM but insert it from a username@MAC onto an MySQL DB
>
> Lucio Godoy wrote:
> > I have been reading unlang and also digging the Internet for help with
> > my issue.
> >
> > I have added the following line to "vi sql/mysql/dialup.conf"
>
> Nope. As the "man" page says, you need to put the if/else/update
> statements into the "authorize" section.
>
> Alan DeKok.
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Do you want a Hotmail account? Sign-up now - Free