我已将此块添加到 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'"
}
并添加了字典
ATTRIBUTE Max-Monthly-Traffic 3003 integer
ATTRIBUTE Monthly-Traffic-Limit 3004 integer
然后添加monthlytrafficcounter
到authorize
/etc/freeradius/sites-enabled/default
但它不起作用
Max-Monthly-Traffic
在 MySQL 表中定义,用户radgroupcheck
已添加到组中radusergroup
用户虽然达到了流量限制,但仍然可以通过 FreeRadius 授权:http: //i.stack.imgur.com/RIVsZ.jpg