Monthly traffic limit

MegaHostZone Santu Roy san2roy at gmail.com
Fri Jul 11 07:51:47 CEST 2014


Hello

I have setup freeradius with mikrotik as NAS. I am working on a ISP project
where i need to make some package like traffic limit per month

for example one user can use 4GB of traffic with speed of 1mbps after the
4GB we will be disconnect automatically...

i configure counter.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'"
}

And added following in mysql database table radcheck

| username | attribute | op | value || user  | Cleartext-Password | := |
internet |
| user  | Mikrotik-Xmit-Limit-Gigawords | := | 2 |
| user  | Expiration | := | 08 Aug 2014 |


but this is not working kindly help to solve this problem

-- 

*Regards*Santu Roy
www.megahostzone.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-devel/attachments/20140711/130a63e3/attachment.html>


More information about the Freeradius-Devel mailing list