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