Setting realm from called station id regex

Christopher Manigan cmanigan at towerstream.com
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.

Chris
________________________________________
From: freeradius-users-bounces+cmanigan=towerstream.com at lists.freeradius.org [freeradius-users-bounces+cmanigan=towerstream.com at lists.freeradius.org] on behalf of Phil Mayers [p.mayers at imperial.ac.uk]
Sent: Monday, July 23, 2012 11:29 AM
To: freeradius-users at lists.freeradius.org
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
accounting.

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 http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list