Community discussions

MikroTik App
 
User avatar
TheWiFiGuy
Member
Member
Topic Author
Posts: 351
Joined: Thu Nov 24, 2011 7:26 pm
Location: UK

Mikrotik-Xmit-Limit and Freeradius

Wed Feb 15, 2012 11:27 pm

Hi All

Is anyone using Mikrotik-Xmit-Limit with freeradius to limit a customers upload/download limits (per month/day) etc? If so, would you care to share the Freeradius mysql counter code - i'll purchase it if needs be.

Regards
 
User avatar
TheWiFiGuy
Member
Member
Topic Author
Posts: 351
Joined: Thu Nov 24, 2011 7:26 pm
Location: UK

Re: Mikrotik-Xmit-Limit and Freeradius

Wed Feb 15, 2012 11:33 pm

LOL, after 60 minutes of searching, i rephased the question after posting and ended up with this:

Note: This code is not 100% correct, as from looking at it, it will return null the fist time its used as no accounting packets are present - select statement needs updating to return 0 if null.

sqlcounter downloadbytecounter {
counter-name = Mikrotik-Xmit-Limit
check-name = Mikrotik-Xmit-Limit
reply-name = Mikrotik-Xmit-Limit
sqlmod-inst = sql
key = User-Name
reset = never
query = "SELECT SUM(acctoutputoctets) FROM radacct WHERE
username='%{%k}'"
}



In sites-available/default

authorize {
downloadbytecounter
 
kkwised
just joined
Posts: 2
Joined: Wed Aug 08, 2012 1:00 pm
Location: Ghana
Contact:

Re: Mikrotik-Xmit-Limit and Freeradius

Wed Aug 08, 2012 1:06 pm

HI
I am trying to set Mikrotik Limit uptime in FreeRADIUS. any ideas how freeRADIUS does that?
 
User avatar
KatsuroKurosaki
just joined
Posts: 18
Joined: Tue Jul 24, 2012 10:53 am
Contact:

Re: Mikrotik-Xmit-Limit and Freeradius

Mon Aug 13, 2012 12:51 pm

At the query line, try using this SQL statement:
query = "SELECT IFNULL(SUM(acctoutputoctets),0) FROM radacct WHERE username='%{%k}'" 
My advice is to use a single line for the SQL query.

Who is online

Users browsing this forum: GoogleOther [Bot] and 90 guests