Setting realm from called station id regex

Christopher Manigan cmanigan at
Mon Jul 23 18:02:50 CEST 2012

That worked, thanks.  Just had to fix your example from "calling" to "called".  Other than that, perfect.

From: at [ at] on behalf of Phil Mayers [p.mayers at]
Sent: Monday, July 23, 2012 11:29 AM
To: freeradius-users at
Subject: Re: Setting realm from called station id regex

On 23/07/12 16:03, Christopher Manigan wrote:
> Hello,
> I have some devices that report to radius accounting but do not do any authentication or authorization.  For these sessions in accounting, I would like to set a realm based on the called station id.  The called station id ends with a colon and the SSID.  I thought I could write a simple regular expression for the ssid and set the realm.  Here is what I have right now, but it does not seem to be working:
> DEFAULT         Called-Station-Id =~ "myssid"
>    Realm = "myrealm"

That's probably updating the reply, which is not even meaningful for

You need to use unlang, so that you can specify which variable list to
update. For example:

preacct {
   if (Calling-Station-Id =~ /myssid/) {
     update request {
       Realm := myrealm
List info/subscribe/unsubscribe? See

More information about the Freeradius-Users mailing list