Page 1 of 1

Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Thu Jun 14, 2007 9:55 pm
by viagoth
Hi i need to assign uptime limit to my user (no session limit) but i can't find (or not exsist) the voule of attribute for radreply table for setting the uptime limit....:( anyone can help me ??? sorry for my english...

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Sat Jun 16, 2007 9:34 am
by viagoth
Please...anyone can help me ???? :(:(:(:(:(:(:(

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Sat Jun 16, 2007 4:44 pm
by nhalachev
Hi i need to assign uptime limit to my user (no session limit) but i can't find (or not exsist) the voule of attribute for radreply table for setting the uptime limit...
Read freeradius docs and wiki about rlm_sqlcounter module ... hope this helps.

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Sun Jun 17, 2007 5:59 pm
by viagoth
If i insert in radcheck 2 users test with 2 other attribute(:= Max-All-Session and == 'password'), at the login time radius response Username or password incorrect.

SELECT *
FROM `radcheck`

+----+----------------+-----------------+----+------------+
| id | UserName | Attribute | op | Value |
+----+----------------+-----------------+----+------------+
| 83 | test | User-Password | == | test |
| 84 | test | Max-All-Session | := | 20 |
+----+----------------+-----------------+----+------------+

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Sun Jun 17, 2007 8:17 pm
by viagoth
ok i have resolve the problem for authentication....but...after time expire...user don't logout :( WHY ???? :(
Sorry for my english

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Mon Jun 18, 2007 10:26 pm
by viagoth
...anyone can give me the files conf ??? pls !!! i need it !!!!

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Mon Jul 28, 2008 11:17 pm
by lagosta
Does the Mikrotik recognize the Max-all-session attribute?
What is the best attribute to use in FreeRadius with the same function as Uptime Limit?

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Mon Jul 28, 2008 11:48 pm
by natedogg104
If i were you id use radiusmanager, it can do all that plus more with less configurations. Victor is a cool cat and he runs and operates the software, im using it now with 60-100 users active spanning 13 hotspots
http://www.dmasoftlab.com/cont/home
hope this helps, btw i made my own just like you did and then went radmanager soon as i seen it

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Tue Jul 29, 2008 12:03 am
by lagosta
I'm using MT + FreeRadius + MySql and i have the authentication scenario working, but i can't find one attribute that replaces the Uptime limit.

I'm also using Daloradius because it's easier to create users and set their attributes.
If you have profiles in Daloradius it recognizes the attributes and set the attribute to radcheck or radreply automatically. I think it's a good choice for you, and it's free :)

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Fri Aug 01, 2008 12:02 pm
by micha94
hi,

may be this link will help you:

http://freeradius.org/rfc/rfc2866.html# ... ssion-Time

Regards

Michael

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Thu Aug 14, 2008 9:06 pm
by lagosta
I think this attribute (acct-session-time) only returns the time ( in seconds ) that the user was receiving service. I cannot set it's value so it would decrease.
I think the value is set to 0 by deault and than will increase the number of seconds the user was receiving service.

Anyone... help :)

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute???

Posted: Tue Aug 19, 2008 5:34 pm
by micha94
hi,

maybe you should participate the mailinglist from freeradius.org

alan de kook will help you ;-)

greets

michael

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute??

Posted: Fri Mar 26, 2010 8:03 pm
by risipetillo
Has anyone figured out how to set the Uptime-Limit via Freeradius.

So that customers connected will be disconnected once that Uptime-Limit is hit?

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute??

Posted: Fri Mar 26, 2010 8:12 pm
by fewi
I have no idea if there's an easy solution via built in features, but a viable solution would be to use a DB trigger that takes the Acct-Session-Time value when inserting an ACCOUNTING STOP record, and updates the value for an attribute used to set Session-Timeout. That way you can just serve that well supported value at session start - if the client browses for longer than he's got uptime for, he'll just get disconnected. If he disconnects before that, the time used is subtracted from the maximum uptime he can have next session. Not particularly elegant, but if no one else can find an elegant solution it might be worth trying.

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute??

Posted: Sat Mar 27, 2010 1:09 pm
by SurferTim
I use "WISPr-Session-Terminate-Time" in the radreply table to limit uptime. Once that time is past, the client is logged out and cannot login again. You must have NTP client set in the router, or this doesn't work.

This time format was a little tricky. It is "yyyy-mm-ddThh:mm:ss". Note the date/time separator is an upper case 'T'.

ADD: I noticed there is also a "Session-Timeout" attribute available. I think it also goes in the radreply table. The 'op' is '<=' and the value is in seconds.

If you are looking for a cumulative counter that tracks uptime totals from all sessions, that is a FreeRADIUS function. You will probably need to activate one of the counter scripts in the FreeRADIUS setup. From my understanding, it will start the "Session-Timeout" value at the original setting in the radreply table, and every logout, the script subtracts the uptime from that session. The next login, the "Session-Timeout" value sent for that user will be less. Search your radiusd.conf file for 'counter daily'.

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute??

Posted: Tue Mar 30, 2010 1:05 am
by sasskass
Yes,

it was problem for us also implementing hotspot with time limit because mt without user manager does not have such option.
as we dont want to use mt-s usermanager found that freeradius sql counter make the trick.


sqlcounter accessperiod {
counter-name = period
check-name = period
sqlmod-inst = sql
key = User-Name
reset = never
query = "SELECT ABS(EXTRACT(EPOCH FROM AcctStartTime - now())::integer) \
FROM radacct \
WHERE UserName='%{%k}' \
ORDER BY AcctStartTime \
LIMIT 1;"
}


For easy management we are using daloradius gui.

Best regards

Aleksander

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute??

Posted: Thu Apr 01, 2010 5:08 am
by roadracer96
sqlcounter dailycounter {
counter-name = Daily-Session-Time
check-name = Max-Daily-Session
sqlmod-inst = sql
key = User-Name
reset = daily
query = "SELECT SUM(AcctSessionTime - GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'"
}

Then put a Max-Daily-Session check on the user or group. IE: 360 for 1 hour/day.

Works like a champ.

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute??

Posted: Tue Apr 20, 2010 12:42 pm
by doush
Can you add your own check attributes to the sqlcounter file and use them without any problem ?

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute??

Posted: Tue Oct 05, 2010 6:11 am
by jober
Has anyone tried CIITIX?
http://ciitix.ciit.net.pk/index.php/ciitix-wifi
What is CIITIX-WiFi ?
CIITIX-WiFi is a turnkey solution to your WiFi network needs.
Just download the ISO burn to disc and install.
It has debian,freeradius,mysql,daloradius with an easy install gui

Nix that, it's missing a few things.

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute??

Posted: Wed Oct 09, 2013 3:00 pm
by moisesmelo
Good morning!

Someone managed to solve this problem? I'm in the same situation!!

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute??

Posted: Mon Oct 14, 2013 2:38 pm
by moisesmelo
tracking solution, applied last week:

You can make this setting,
Only enable checking daily in radius.conf, site-available/default, site-enable/default.Isso will accept the daily check and enable the module count daily.
{instantiate
         daily
}
authorize {
         daily
}
On / modules / couter this counters daily, uncomment the module attribute and daily diary, in command verficação SQL, replace the radiusaccounting to radacct, which will check the day count of the User:
query = "SELECT IFNULL (SUM (acctsessiontime - GREATEST ((% b - UNIX_TIMESTAMP (acctstarttime)), 0)), 0) FROM radacct WHERE username = '% {% k}' AND UNIX_TIMESTAMP (acctstarttime) + acctsessiontime> '% b '"

Re: Mikrotik+Freeradius+MySql -> No Uptime Limit Attribute??

Posted: Sat Oct 19, 2013 10:15 am
by shayanjameel08
think the value is set to 0 by deault and than will increase the number of seconds the user was receiving service.