Community discussions

MikroTik App
 
viagoth
just joined
Topic Author
Posts: 19
Joined: Thu Jun 14, 2007 5:59 am

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

Thu Jun 14, 2007 9:55 pm

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...
 
viagoth
just joined
Topic Author
Posts: 19
Joined: Thu Jun 14, 2007 5:59 am

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

Sat Jun 16, 2007 9:34 am

Please...anyone can help me ???? :(:(:(:(:(:(:(
 
nhalachev
Frequent Visitor
Frequent Visitor
Posts: 99
Joined: Fri May 28, 2004 4:41 pm
Location: Bulgaria

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

Sat Jun 16, 2007 4:44 pm

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.
 
viagoth
just joined
Topic Author
Posts: 19
Joined: Thu Jun 14, 2007 5:59 am

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

Sun Jun 17, 2007 5:59 pm

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 |
+----+----------------+-----------------+----+------------+
 
viagoth
just joined
Topic Author
Posts: 19
Joined: Thu Jun 14, 2007 5:59 am

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

Sun Jun 17, 2007 8:17 pm

ok i have resolve the problem for authentication....but...after time expire...user don't logout :( WHY ???? :(
Sorry for my english
 
viagoth
just joined
Topic Author
Posts: 19
Joined: Thu Jun 14, 2007 5:59 am

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

Mon Jun 18, 2007 10:26 pm

...anyone can give me the files conf ??? pls !!! i need it !!!!
 
lagosta
just joined
Posts: 21
Joined: Sun May 11, 2008 10:02 pm

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

Mon Jul 28, 2008 11:17 pm

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?
 
User avatar
natedogg104
Member Candidate
Member Candidate
Posts: 157
Joined: Tue Feb 28, 2006 9:18 am

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

Mon Jul 28, 2008 11:48 pm

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
 
lagosta
just joined
Posts: 21
Joined: Sun May 11, 2008 10:02 pm

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

Tue Jul 29, 2008 12:03 am

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 :)
 
micha94
just joined
Posts: 19
Joined: Wed Mar 19, 2008 2:45 pm

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

Fri Aug 01, 2008 12:02 pm

hi,

may be this link will help you:

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

Regards

Michael
 
lagosta
just joined
Posts: 21
Joined: Sun May 11, 2008 10:02 pm

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

Thu Aug 14, 2008 9:06 pm

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 :)
 
micha94
just joined
Posts: 19
Joined: Wed Mar 19, 2008 2:45 pm

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

Tue Aug 19, 2008 5:34 pm

hi,

maybe you should participate the mailinglist from freeradius.org

alan de kook will help you ;-)

greets

michael
 
risipetillo
Frequent Visitor
Frequent Visitor
Posts: 63
Joined: Tue Feb 03, 2009 7:08 pm

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

Fri Mar 26, 2010 8:03 pm

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?
 
fewi
Forum Guru
Forum Guru
Posts: 7717
Joined: Tue Aug 11, 2009 3:19 am

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

Fri Mar 26, 2010 8:12 pm

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.
 
SurferTim
Forum Guru
Forum Guru
Posts: 4636
Joined: Mon Jan 07, 2008 10:31 pm
Location: Miramar Beach, Florida

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

Sat Mar 27, 2010 1:09 pm

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'.
 
sasskass
Frequent Visitor
Frequent Visitor
Posts: 84
Joined: Wed Mar 15, 2006 4:39 pm

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

Tue Mar 30, 2010 1:05 am

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
 
roadracer96
Forum Veteran
Forum Veteran
Posts: 730
Joined: Tue Aug 25, 2009 12:01 am

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

Thu Apr 01, 2010 5:08 am

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.
 
doush
Long time Member
Long time Member
Posts: 665
Joined: Thu Jun 04, 2009 3:11 pm

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

Tue Apr 20, 2010 12:42 pm

Can you add your own check attributes to the sqlcounter file and use them without any problem ?
 
jober
Long time Member
Long time Member
Posts: 690
Joined: Fri May 28, 2004 12:16 pm
Location: Louisiana,USA

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

Tue Oct 05, 2010 6:11 am

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.
 
moisesmelo
just joined
Posts: 3
Joined: Tue Oct 08, 2013 2:30 pm

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

Wed Oct 09, 2013 3:00 pm

Good morning!

Someone managed to solve this problem? I'm in the same situation!!
 
moisesmelo
just joined
Posts: 3
Joined: Tue Oct 08, 2013 2:30 pm

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

Mon Oct 14, 2013 2:38 pm

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 '"
 
shayanjameel08
just joined
Posts: 8
Joined: Sat Oct 12, 2013 10:02 am

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

Sat Oct 19, 2013 10:15 am

think the value is set to 0 by deault and than will increase the number of seconds the user was receiving service.

Who is online

Users browsing this forum: baragoon and 26 guests