Discussion:
Adding Filter-Id Attribute to Accounting Requests
Alessandro Romano
2018-10-24 13:48:58 UTC
Permalink
Dear All,

i need to add the attribute "Filter-ID" from database radusergroup to
accounting-request packet.



At the moment i retreive the attribute only in access-accept packet



BR







Alessandro Romano

C.T.O.

Cell: 3351402534



Positivo SRL

Via San Leonardo 52

84131 Salerno ( Sa )
Alan DeKok
2018-10-24 13:54:19 UTC
Permalink
Post by Alessandro Romano
i need to add the attribute "Filter-ID" from database radusergroup to
accounting-request packet.
At the moment i retreive the attribute only in access-accept packet
You can run the SQL "authorize" queries when the server receives an accounting packet:

accounting {
...
sql.authorize
...
}

It will run *all* of the SQL authorization queries. But it will mostly do what you want.

Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.o
Alessandro Romano
2018-10-24 14:09:14 UTC
Permalink
Dear Alan,

I have no idea how to do it,
I have to add the filter-id attribute in the accounting-request packet by taking it from the database,
I can also do it in pre-proxy but I do not know how to do it

-----Messaggio originale-----
Da: Freeradius-Users <freeradius-users-bounces+alessandro.romano=***@lists.freeradius.org> Per conto di Alan DeKok
Inviato: mercoledì 24 ottobre 2018 15.54
A: FreeRadius users mailing list <freeradius-***@lists.freeradius.org>
Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests
Post by Alessandro Romano
i need to add the attribute "Filter-ID" from database radusergroup to
accounting-request packet.
At the moment i retreive the attribute only in access-accept packet
You can run the SQL "authorize" queries when the server receives an accounting packet:

accounting {
...
sql.authorize
...
}

It will run *all* of the SQL authorization queries. But it will mostly do what you want.

Alan DeKok.


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


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/
Alan DeKok
2018-10-24 14:18:20 UTC
Permalink
Post by Alessandro Romano
I have no idea how to do it,
That's odd. I told you *exactly* how to do it.

Are you going to do what I suggested?
Post by Alessandro Romano
I have to add the filter-id attribute in the accounting-request packet by taking it from the database,
You've said that before. There's no need to say it again.

Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freer
Alessandro Romano
2018-10-24 14:21:20 UTC
Permalink
I do not know how to do it, can you help me, posting some examples?

-----Messaggio originale-----
Da: Freeradius-Users <freeradius-users-bounces+alessandro.romano=***@lists.freeradius.org> Per conto di Alan DeKok
Inviato: mercoledì 24 ottobre 2018 16.18
A: FreeRadius users mailing list <freeradius-***@lists.freeradius.org>
Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests
Post by Alessandro Romano
I have no idea how to do it,
That's odd. I told you *exactly* how to do it.

Are you going to do what I suggested?
Post by Alessandro Romano
I have to add the filter-id attribute in the accounting-request packet by taking it from the database,
You've said that before. There's no need to say it again.

Alan DeKok.


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


-
List info/subscribe/un
Alan DeKok
2018-10-24 14:24:18 UTC
Permalink
Post by Alessandro Romano
I do not know how to do it, can you help me, posting some examples?
I posted an example. As I said already.

Do you understand what the "accounting" section is for? Do you know where it is located?

If so, you know how to interpret the example I gave. If not, then you need to understand how the server works before editing the configuration files.

Alan DeKok.


-
List info/subscribe/unsubscribe? See
Alessandro Romano
2018-10-24 14:27:28 UTC
Permalink
If you mean
The accounting section of sites-enabled/default
But , i've the queries in dialup.conf file under /sql/mysql

If you want i can post you all the config files

-----Messaggio originale-----
Da: Freeradius-Users <freeradius-users-bounces+alessandro.romano=***@lists.freeradius.org> Per conto di Alan DeKok
Inviato: mercoledì 24 ottobre 2018 16.24
A: FreeRadius users mailing list <freeradius-***@lists.freeradius.org>
Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests
Post by Alessandro Romano
I do not know how to do it, can you help me, posting some examples?
I posted an example. As I said already.

Do you understand what the "accounting" section is for? Do you know where it is located?

If so, you know how to interpret the example I gave. If not, then you need to understand how the server works before editing the configuration files.

Alan DeKok.


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


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.h
Alessandro Romano
2018-10-24 14:45:19 UTC
Permalink
If you mean
The accounting section of sites-enabled/default But , i've the queries in dialup.conf file under /sql/mysql

If you want i can post you all the config files

I dont know the scripting syntax to handle packets, attributes ecc ecc

-----Messaggio originale-----
Da: Freeradius-Users <freeradius-users-bounces+alessandro.romano=***@lists.freeradius.org> Per conto di Alan DeKok
Inviato: mercoledì 24 ottobre 2018 16.24
A: FreeRadius users mailing list <freeradius-***@lists.freeradius.org>
Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests
Post by Alessandro Romano
I do not know how to do it, can you help me, posting some examples?
I posted an example. As I said already.

Do you understand what the "accounting" section is for? Do you know where it is located?

If so, you know how to interpret the example I gave. If not, then you need to understand how the server works before editing the configuration files.

Alan DeKok.


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


-
List info/subscribe/unsubscribe? See http://www.freeradius.o
Alan DeKok
2018-10-24 15:00:24 UTC
Permalink
Post by Alessandro Romano
If you mean
The accounting section of sites-enabled/default
Yes.
Post by Alessandro Romano
But , i've the queries in dialup.conf file under /sql/mysql
Why does that matter?

The problem here is that you're not willing to believe me when I give you advice. You need to fix that.
Post by Alessandro Romano
If you want i can post you all the config files
No. Why would I want to post configuration files that already exist in the server? I know very well what they say,
Post by Alessandro Romano
I dont know the scripting syntax to handle packets, attributes ecc ecc
Read the documentation. Read the default configuration files. It's 2018, all of this is documented in excruciating detail.

And read this:

https://networkradius.com/doc/FreeRADIUS-Technical-Guide.pdf

It's the best introduction to RADIUS.

You need to spend time to understand how RADIUS works, and how FreeRADIUS works. Don't edit the configuration files until then.

Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.htm
Alessandro Romano
2018-10-24 15:08:11 UTC
Permalink
Forgive me, but it is not true that I do not believe you, perhaps my English is not the best

the problem is that I can not do it and I need help

-----Messaggio originale-----
Da: Freeradius-Users <freeradius-users-bounces+alessandro.romano=***@lists.freeradius.org> Per conto di Alan DeKok
Inviato: mercoledì 24 ottobre 2018 17.00
A: FreeRadius users mailing list <freeradius-***@lists.freeradius.org>
Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests
Post by Alessandro Romano
If you mean
The accounting section of sites-enabled/default
Yes.
Post by Alessandro Romano
But , i've the queries in dialup.conf file under /sql/mysql
Why does that matter?

The problem here is that you're not willing to believe me when I give you advice. You need to fix that.
Post by Alessandro Romano
If you want i can post you all the config files
No. Why would I want to post configuration files that already exist in the server? I know very well what they say,
Post by Alessandro Romano
I dont know the scripting syntax to handle packets, attributes ecc ecc
Read the documentation. Read the default configuration files. It's 2018, all of this is documented in excruciating detail.

And read this:

https://networkradius.com/doc/FreeRADIUS-Technical-Guide.pdf

It's the best introduction to RADIUS.

You need to spend time to understand how RADIUS works, and how FreeRADIUS works. Don't edit the configuration files until then.

Alan DeKok.


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


-
List info/subscribe/unsub
Alan DeKok
2018-10-24 15:13:47 UTC
Permalink
Post by Alessandro Romano
Forgive me, but it is not true that I do not believe you, perhaps my English is not the best
the problem is that I can not do it and I need help
I've helped you as much as I can. You know what file to edit. You know what to add to that file.

Please stop asking for more help. Instead, go read the documentation.

Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/u
Alessandro Romano
2018-11-05 15:46:36 UTC
Permalink
Hi Alan,
i've solved problem in this way

#
# Pre-accounting. Decide which accounting type to use.
#
preacct {
preprocess
update request {
Filter-ID :="%{sql:SELECT groupname FROM radusergroup WHERE username='%{User-Name}'}"
}

acct_unique
suffix
files
update control {
Replicate-To-Realm := "ALLOT-SMP"
}
}

And it works, can you tell me if the procedure is correct , or it can cause problems

BR

-----Messaggio originale-----
Da: Freeradius-Users <freeradius-users-bounces+alessandro.romano=***@lists.freeradius.org> Per conto di Alan DeKok
Inviato: mercoledì 24 ottobre 2018 17.14
A: FreeRadius users mailing list <freeradius-***@lists.freeradius.org>
Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests
Post by Alessandro Romano
Forgive me, but it is not true that I do not believe you, perhaps my English is not the best
the problem is that I can not do it and I need help
I've helped you as much as I can. You know what file to edit. You know what to add to that file.

Please stop asking for more help. Instead, go read the documentation.

Alan DeKok.


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


-
List info/subscribe/unsubscribe? See http:
Alan DeKok
2018-11-05 18:28:17 UTC
Permalink
Post by Alessandro Romano
And it works, can you tell me if the procedure is correct , or it can cause problems
It should be fine.

Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/lis
Alan Buxey
2018-10-24 15:28:23 UTC
Permalink
Please read what Alan already said, down below
Yes, just add that sql.authorize to your accounting section. Run server in
debug mode to see what that is doing. (This calls the authorize method for
your configured SQL module just as normally in the access request
packets...but for an accounting packet instead (as a plain call to SQL
will, in accounting section, just do the normal save data thing ;) ) )

alan
On Oct 24, 2018, at 9:48 AM, Alessandro Romano <
Post by Alessandro Romano
i need to add the attribute "Filter-ID" from database radusergroup to
accounting-request packet.
At the moment i retreive the attribute only in access-accept packet
accounting {
...
sql.authorize
...
}
It will run *all* of the SQL authorization queries. But it will mostly do what you want.
Alan DeKok.
-
List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html
-
List info/subscribe/unsubscribe? See http://www.freer
Continue reading on narkive:
Loading...