Modify Accounting records
Andrés Gómez
andres.gomez.ruiz at gmail.com
Tue Mar 29 00:04:32 CEST 2016
Hi Alan and dear list.
Following the Alan's advice a did this:
My policy.conf:
rewrite_called_station_id {
update request {
Calling-Station-Id := "aaa"
}
}
----
The I add "rewrite_called_station_id" in the "authorize" and "preacct" in
default server on site-available:
authorize {
rewrite_called_station_id
...
preacct {
preprocess
rewrite_called_station_id
----
Debbug says me:
FreeRADIUS Version 2.1.12, for host x86_64-pc-linux-gnu, built on Aug 26
2015 at 14:47:03
...
Module: Checking authorize {...} for more modules to load
Module: Loading virtual module rewrite_called_station_id
Module: Linked to module rlm_preprocess
Module: Instantiating module "preprocess" from file
/etc/freeradius/modules/preprocess
....
rlm_sql (sql): Connected new DB handle, #4
Module: Checking preacct {...} for more modules to load
Module: Loading virtual module rewrite_called_station_id
Module: Linked to module rlm_acct_unique
Module: Instantiating module "acct_unique" from file
/etc/freeradius/modules/acct_unique
but when I look for the radacct log I see:
Mon Mar 28 16:23:06 2016
Acct-Session-Id = "56F9A10D-33493000"
Framed-IP-Address = 192.168.25.36
Acct-Multi-Session-Id = "8c0c907349381ccb9969ef9156f9a10d00b8"
Acct-Link-Count = 1
Acct-Status-Type = Start
Acct-Authentic = RADIUS
User-Name = "mono"
NAS-IP-Address = 192.168.25.29
NAS-Identifier = "8C-0C-90-33-49-30"
NAS-Port = 2
Called-Station-Id = "8c-0c-90-73-49-38:PortalCautivoSmartA"
Calling-Station-Id = "1C-CB-99-69-EF-91"
NAS-Port-Type = Wireless-802.11
These logs must be affected by the rewrite rule? how can I test if the rule
is working?
Regards
2016-03-16 12:06 GMT-05:00 Alan DeKok <aland at deployingradius.com>:
> On Mar 16, 2016, at 12:52 PM, Andrés Gómez <andres.gomez.ruiz at gmail.com>
> wrote:
> > I'm using a NAS that sends its accounting data fine, but it send its MAC
> > address in the calledstationid data, but it use a " - " as separator
> > instead of ":" like my other NAS.
> >
> > Is there a way to change that " - " character by the " : " when it
> arrives?
> > May be using ulang?
>
> See rewrite_called_station_id in raddb/policy.conf (2.2), or in
> policy.d/canonicalization (3.0)
>
> You can use it as an example to write your own re-write rules.
>
> Alan DeKok.
>
>
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
--
*C. Andrés Gómez R.*
More information about the Freeradius-Users
mailing list