我已将此块添加到 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 授权