Hello, its a log time i tm trying to limit anonymusers in freeradius, i have tried many things but somehow not working or not stable !have an idea ! is it possible to put anonym user in the group and make some group policies ?im trying to limit time and data usage for anonymusers who login with mac address ! im really get mad about this ! i got this task 2 month ago and i cant finish it ! would you please help me ? Thanks
On May 16, 2019, at 7:52 AM, myxmail1919--- via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
its a log time i tm trying to limit anonymusers in freeradius, i have tried many things but somehow not working or not stable !have an idea ! is it possible to put anonym user in the group and make some group policies ?im trying to limit time and data usage for anonymusers who login with mac address ! im really get mad about this ! i got this task 2 month ago and i cant finish it ! would you please help me ? Thanks
If you want to limit time / data usage, then you can key off of Calling-Station-Id, instead of User-Name. Perhaps you could give a *clear description* of what you did. See the docs at http://wiki.freeradius.org/list-help Right now, it's just "I tried stuff and it didn't work". There's no way we can give any useful advice here. Alan DeKok.
@Alan DeKok so first i used sql daily counters, but it didnt work ! bcs as i know its works only for predefined users, then i made an sql query in authorization section to check data usage for last 24 hours if("%{sql:SELECT SUM(acctoutputoctets) FROM radacct WHERE username = '%{User-Name}' AND acctstarttime BETWEEN NOW()-INTERVAL 1 DAY AND NOW() having SUM(acctoutputoctets) < 314572800 }" > 1 ) { ok update control { Auth-Type := Accept } } else { reject } its didnt work in some networks , because only authentication and accounting packets are sent and not authorization , every networks has more than 2.000 auth req per minute and where authorization packets are sent it gonna be huge load on mysql and sessions takes long time to be stablished and often session time out ...! thanks On Thursday, May 16, 2019, 2:44:30 PM GMT+2, Alan DeKok <aland@deployingradius.com> wrote: On May 16, 2019, at 7:52 AM, myxmail1919--- via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
its a log time i tm trying to limit anonymusers in freeradius, i have tried many things but somehow not working or not stable !have an idea ! is it possible to put anonym user in the group and make some group policies ?im trying to limit time and data usage for anonymusers who login with mac address ! im really get mad about this ! i got this task 2 month ago and i cant finish it ! would you please help me ? Thanks
If you want to limit time / data usage, then you can key off of Calling-Station-Id, instead of User-Name. Perhaps you could give a *clear description* of what you did. See the docs at http://wiki.freeradius.org/list-help Right now, it's just "I tried stuff and it didn't work". There's no way we can give any useful advice here. Alan DeKok.
On May 16, 2019, at 8:59 AM, myxmail1919--- via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
@Alan DeKok
so first i used sql daily counters, but it didnt work ! bcs as i know its works only for predefined users,
You can use sql counters. Just read the documentation in raddb/mods-available/sqlcounter Change the key from "User-Name" to "Calling-Station-Id". If the Calling-Station-Id is just a MAC address, it will work.
then i made an sql query in authorization section to check data usage for last 24 hours
That may also work, too.
its didnt work in some networks , because only authentication and accounting packets are sent and not authorization ,
There are no "authorization" packets in RADIUS.
every networks has more than 2.000 auth req per minute and where authorization packets are sent it gonna be huge load on mysql and sessions takes long time to be stablished and often session time out ...!
2K requests per minute is 33 request/s. Any reasonable SQL database should be able to handle that load. Alan DeKok.
Sql query doesnt work under heavy load ! i dont know why ! it working in small netwokrs with max 20-30 requests per minute but when i get more than 10 request per second it somehow skipping authorization part, would you please tell me where can i set " Max-Daily-Session " whe i have no users and users are anonym ? in user.conf i can use this for existing user : test Max-All-Session := 54000, Cleartext-Password := "test" but when i have no users how can i set max-daily-session ? Thanks On Thursday, May 16, 2019, 3:11:56 PM GMT+2, Alan DeKok <aland@deployingradius.com> wrote: On May 16, 2019, at 8:59 AM, myxmail1919--- via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
@Alan DeKok
so first i used sql daily counters, but it didnt work ! bcs as i know its works only for predefined users,
You can use sql counters. Just read the documentation in raddb/mods-available/sqlcounter Change the key from "User-Name" to "Calling-Station-Id". If the Calling-Station-Id is just a MAC address, it will work.
then i made an sql query in authorization section to check data usage for last 24 hours
That may also work, too.
its didnt work in some networks , because only authentication and accounting packets are sent and not authorization ,
There are no "authorization" packets in RADIUS.
every networks has more than 2.000 auth req per minute and where authorization packets are sent it gonna be huge load on mysql and sessions takes long time to be stablished and often session time out ...!
2K requests per minute is 33 request/s. Any reasonable SQL database should be able to handle that load. Alan DeKok.
On May 16, 2019, at 9:22 AM, myxmail1919--- via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Sql query doesnt work under heavy load ! i dont know why !
SQL queries don't change when the server is under heavy load. Find out what's going wrong. And saying "it doesn't work" is just wrong. WHAT doesn't work? Be *specific*.
it working in small netwokrs with max 20-30 requests per minute but when i get more than 10 request per second it somehow skipping authorization part,
No, it doesn't.
would you please tell me where can i set " Max-Daily-Session " whe i have no users and users are anonym ?
It's an attribute. You can set it anywhere. e.g. raddb/sites-enabled/default
in user.conf i can use this for existing user :
test Max-All-Session := 54000, Cleartext-Password := "test" but when i have no users how can i set max-daily-session ?
You can set a DEFAULT. This is *all documented*. All you need to do is read the docs. Alan DeKok/
@Alan DeKok thank u , with your help its working, the only issue now that im trying to fix it is the Counter will not Reset Daily ! not allowing user to log in in next day when user exceeded time limits ! Reset time is already set to Daily ! sqlcounter dailycounter { reset = daily } is there anything else that need to change ? On Thursday, May 16, 2019, 4:12:18 PM GMT+2, Alan DeKok <aland@deployingradius.com> wrote: On May 16, 2019, at 9:22 AM, myxmail1919--- via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
Sql query doesnt work under heavy load ! i dont know why !
SQL queries don't change when the server is under heavy load. Find out what's going wrong. And saying "it doesn't work" is just wrong. WHAT doesn't work? Be *specific*.
it working in small netwokrs with max 20-30 requests per minute but when i get more than 10 request per second it somehow skipping authorization part,
No, it doesn't.
would you please tell me where can i set " Max-Daily-Session " whe i have no users and users are anonym ?
It's an attribute. You can set it anywhere. e.g. raddb/sites-enabled/default
in user.conf i can use this for existing user :
test Max-All-Session := 54000, Cleartext-Password := "test" but when i have no users how can i set max-daily-session ?
You can set a DEFAULT. This is *all documented*. All you need to do is read the docs. Alan DeKok/
i mean where to set Max Daily Session time for Calling station ID ? On Thursday, May 16, 2019, 3:11:56 PM GMT+2, Alan DeKok <aland@deployingradius.com> wrote: On May 16, 2019, at 8:59 AM, myxmail1919--- via Freeradius-Users <freeradius-users@lists.freeradius.org> wrote:
@Alan DeKok
so first i used sql daily counters, but it didnt work ! bcs as i know its works only for predefined users,
You can use sql counters. Just read the documentation in raddb/mods-available/sqlcounter Change the key from "User-Name" to "Calling-Station-Id". If the Calling-Station-Id is just a MAC address, it will work.
then i made an sql query in authorization section to check data usage for last 24 hours
That may also work, too.
its didnt work in some networks , because only authentication and accounting packets are sent and not authorization ,
There are no "authorization" packets in RADIUS.
every networks has more than 2.000 auth req per minute and where authorization packets are sent it gonna be huge load on mysql and sessions takes long time to be stablished and often session time out ...!
2K requests per minute is 33 request/s. Any reasonable SQL database should be able to handle that load. Alan DeKok.
participants (2)
-
Alan DeKok -
myxmail1919@yahoo.com