Hi everyone
So I have spent a few days struggling with getting my FreeRadius up and running with Mikrotik hotspots. I need some help please(I have read through everything I can find online!). I have included the Mikrotik dictionary in my FreeRadius 2 set up.
All I am trying to achieve is the following:
A user must get x mb of data each day. The problem is that the user connects to the hotspot uses his/her data allowance, gets disconnected, then if he/she reconnects they get the same data allowance again(which should only be allowed the next day).
My current set up:
User name in radcheck with a password
User name in radreply with an attribute “Mikrotik-Group” which is = to a Hotspot Profile
User name in radreply with an attribute “Mikrotik-Xmit-Limit” which is = bytes limit
In counter.conf (which is included in radius.conf) I have the following:
sqlcounter mikrotik_max_bytes_withreset {
counter-name = Mikrotik-Xmit-Limit
check-name = Mikrotik-Xmit-Limit
reply-name = Mikrotik-Xmit-Limit
sqlmod-inst = sql
key = User-Name
reset = daily
query = “SELECT SUM(acctinputoctets) + SUM(acctoutputoctets) FROM radacct WHERE username=‘%{%k}’”
}
What am I doing wrong?