I've added this block to radiusd.conf
sqlcounter monthlytrafficcounter {
vcounter-name = Monthly-Traffic
check-name = Max-Monthly-Traffic
reply-name = Monthly-Traffic-LIMIT
sqlmod-inst = SQL
key = User-Name
reset = monthly
query = "SELECT SUM(acctinputoctets + acctoutputoctets) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) > '%b'"
}
and added the ditrctionary
ATTRIBUTE Max-Monthly-Traffic 3003 integer
ATTRIBUTE Monthly-Traffic-Limit 3004 integer
then added monthlytrafficcounter
to authorize
in /etc/freeradius/sites-enabled/default
but it doesn't work
The Max-Monthly-Traffic
is defined in MySQL table radgroupcheck
and the users has added to the group in radusergroup
Although a user has reached the traffic limit, he still can be authorized by FreeRadius: https://i.stack.imgur.com/RIVsZ.jpg