本文接上文《PPTP + FreeRADIUS + MySQL 安装与配置》,请先安装好PPTP + FreeRADIUS + MySQL,然后再继续本文的安装过程。
vi /usr/local/etc/raddb/radiusd.conf
# 取消注释712行, $INCLUDE sql/mysql/counter.conf
vi /usr/local/etc/raddb/sql/mysql/counter.conf
# 最底行加入如下代码:
sqlcounter monthlytrafficcounter {
counter-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'"
}
3 Comments