FR with Mikrotik - FUP Quota Bandwidth not changing auto

AACABLE / Mikrotik System aacable79 at gmail.com
Thu Mar 24 15:27:32 CET 2016


Greetings,

I have FR 2.x with Mikrotik 6.x. I want that when user quota limit end, his
bandwidth package should change from 1mb to 512k. I have made counter and
its working as expected. The only issue is that the changes are not being
done on the fly. Changes applies only when user disconnects, and re-login.
Same thing happens for users whose monthly quota limit finish but they are
keep connected and gets denied only on re-login.

When I issue following command it works fine. (for the bandwidth COA and
POD)

echo User-Name := "zaib", Mikrotik-Rate-Limit = 512k/512k | radclient -x
101.11.11.255:1700 coa 12345
[Mikrotik accepts this command and change the bandwidth on the fly]

echo user-name=zaib | radclient -x 101.11.11.255:1700 disconnect 12345
[Mikrotik accepts this command and disconnects the user as instructed]

How can I do this on the fly using FR? I know its the job of NAS but NAS
will act only when FR will tell him to do so. Kindly assist.


*SQL *Counter:
*=============*
counter-name = Mikrotik-Total-Limit
check-name = Mikrotik-Total-Limit
reply-name = Mikrotik-Total-Limit
sqlmod-inst = sql
key = User-Name
reset = daily
query = "SELECT SUM(AcctInputOctets)+SUM(AcctOutputOctets) FROM radacct
WHERE UserName='%{%k}'"
}
*=============*
*AUTHORIZE *Section:

dailyquota {
reject = 1
}
if (reject) {
ok
update reply {
Mikrotik-Rate-Limit := "512k/512k"
Reply-Message := "You have reached your daily 300MB transfer limit.
Enforcing 512k FUP Policy - zaib "
}
}
*=============*

-- 
Regard's
JAY-Z


More information about the Freeradius-Users mailing list