[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freeradius-users
Subject:    RE: Accounting-Request Re write Rule
From:       Maile Halatuituia <maile.halatuituia () tcc ! to>
Date:       2018-10-25 3:17:19
Message-ID: 64068e70308c41889a7143eb5303c7c5 () mail ! tcc ! to
[Download RAW message or body]

Hi Nathan
Thank you so much for the valuable info I will look in to it and feedback later

cheers

-----Original Message-----
From: Freeradius-Users \
<freeradius-users-bounces+maile.halatuituia=tcc.to@lists.freeradius.org> On Behalf Of \
                Nathan Ward
Sent: Thursday, 25 October 2018 11:39 AM
To: FreeRadius users mailing list <freeradius-users@lists.freeradius.org>
Subject: Re: Accounting-Request Re write Rule



> On 25/10/2018, at 9:51 AM, Maile Halatuituia <maile.halatuituia@tcc.to> wrote:
> 
> Hi
> I need to rewrite this attribute Cisco-AVPair = "acct-input-octets-ipv6=xxx" upon \
> receiving it in the accounting request from my BRAS to my Radius Server so I can \
> further process. 
> I received this  Cisco-AVPair = "acct-input-octets-ipv6=xxx"
> 
> I have done this on the Radius Server /etc/freeradius/sites-available/default
> 
> if( &Cisco-AVPair[*]=~/\(acct-input-octets-ipv6\)=\(\d+)/ ) {
> update request {
> &acct-input-octets-ipv6 := "%{2}"
> }
> }

This won't work as acct-input-octets-ipv6 is not a standard RADIUS attribute. It is \
text as the value of a Cisco-AVPair attribute. You will need to define this attribute \
if you want to be able to use it in your FreeRADIUS config.

> But I have this on my debug
> 
> if ( &Cisco-AVPair[*]=~/\(acct-input-octets-ipv6\)=\(\d+)/ ) {
> 
> (0)            if ( &Cisco-AVPair[*]=~/\(acct-input-octets-ipv6\)=\(\d+)/ )  -> \
> FALSE 

Your regex is not correct. You are not escaping the trailing ), which I presume you \
need to do. You can test this regex with standard regex tools - you should make sure \
your regex is correct and matches examples you feed it. There are a bunch of "online" \
regex testers, if you don't have other ways of doing this.

I don't think you should have brackets around the acct-input-octets-ipv6 either - you \
are not extracting this text. You should only have brackets around the part you wish \
to capture (i.e. the \d), and then use %{1} not %{2}.

> Not sure if I can read it correctly but seem the rule does not matched ..
> Appreciate anyone comments if didn't do it correctly


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Confidentiality Notice: This email (including any attachment) is intended for \
internal use only. Any unauthorized use, dissemination or copying of the content is \
prohibited. If you are not the intended recipient and have received this e-mail in \
error, please notify the sender by email and delete this email and any attachment. \
Confidentiality Notice: This email (including any attachment) is intended for \
internal use only. Any unauthorized use, dissemination or copying of the content is \
prohibited. If you are not the intended recipient and have received this e-mail in \
error, please notify the sender by email and delete this email and any attachment.

-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic