0

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

然后添加monthlytrafficcounterauthorize/etc/freeradius/sites-enabled/default

但它不起作用

Max-Monthly-Traffic在 MySQL 表中定义,用户radgroupcheck已添加到组中radusergroup

用户虽然达到了流量限制,但仍然可以通过 FreeRadius 授权:http: //i.stack.imgur.com/RIVsZ.jpg

4

1 回答 1

0

尝试将您的radiusd.conf块移动到sql/mysql/counter.conf

于 2016-08-28T20:34:30.610 回答