Adding Filter-Id Attribute to Accounting Requests
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 )
On Oct 24, 2018, at 9:48 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
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.
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=positivonet.it@lists.freeradius.org> Per conto di Alan DeKok Inviato: mercoledì 24 ottobre 2018 15.54 A: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests On Oct 24, 2018, at 9:48 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
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
On Oct 24, 2018, at 10:09 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
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?
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.
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=positivonet.it@lists.freeradius.org> Per conto di Alan DeKok Inviato: mercoledì 24 ottobre 2018 16.18 A: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests On Oct 24, 2018, at 10:09 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
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?
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
On Oct 24, 2018, at 10:21 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
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.
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=positivonet.it@lists.freeradius.org> Per conto di Alan DeKok Inviato: mercoledì 24 ottobre 2018 16.24 A: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests
On Oct 24, 2018, at 10:21 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
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
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=positivonet.it@lists.freeradius.org> Per conto di Alan DeKok Inviato: mercoledì 24 ottobre 2018 16.24 A: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests
On Oct 24, 2018, at 10:21 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
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
On Oct 24, 2018, at 10:45 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
If you mean The accounting section of sites-enabled/default
Yes.
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.
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,
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.
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=positivonet.it@lists.freeradius.org> Per conto di Alan DeKok Inviato: mercoledì 24 ottobre 2018 17.00 A: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests On Oct 24, 2018, at 10:45 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
If you mean The accounting section of sites-enabled/default
Yes.
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.
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,
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
On Oct 24, 2018, at 11:08 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
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.
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=positivonet.it@lists.freeradius.org> Per conto di Alan DeKok Inviato: mercoledì 24 ottobre 2018 17.14 A: FreeRadius users mailing list <freeradius-users@lists.freeradius.org> Oggetto: Re: Adding Filter-Id Attribute to Accounting Requests
On Oct 24, 2018, at 11:08 AM, Alessandro Romano <alessandro.romano@positivonet.it> wrote:
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
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 Wed, 24 Oct 2018, 14:54 Alan DeKok, <aland@deployingradius.com> wrote:
On Oct 24, 2018, at 9:48 AM, Alessandro Romano < alessandro.romano@positivonet.it> wrote:
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
participants (3)
-
Alan Buxey -
Alan DeKok -
Alessandro Romano