I have a working FreeRadius installation used for PPPOE clients using a Mikrotik NAS (Essentialy Linux)
I am using Freeradius to limit data a user can send/receive within a month and automatically reset it every month.
I used an example from chilliuspot hotspot for this.
However what im noticing is sometimes a customer gets denied access because he has exceeded he's monthly allowance, however when I check the
Db this is not the case cause it's the beginning of month.
This only happens sometimes so im lost!
I use sqlcounter.conf for the counter part of things and INCLUDE this from radius.conf.
sqlcounter monthlytraffic {
counter-name = Monthly-Traffic
check-name = Max-Monthly-Traffic
reply-name = Mikrotik-Xmit-Limit-Gigawords
sqlmod-inst = sql
key = User-Name
reset = monthly
query = "SELECT SUM(AcctInputOctets - GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0))+ SUM(AcctOutputOctets -GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'"
}
Anybody for input? I would greately appreciate help here! A Work around is to simply increase he's allowance till he is allowed to connect!
Here is an update. I have created an entirely new account that has NO history and yet I get same issue. Following in radius.log Wed Oct 1 17:51:46 2008 : Auth: Invalid user (rlm_sqlcounter: Maximum monthly usage time reached): [njale/<CHAP-Password>] (from client OldPPPOES port 40541 cli 00:0C:29:0B:44:66) I kept increasing the data limit via dialupadmin till it allowed me to connect. Ideas? __________ NOD32 3485 (20081001) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com