Freeradius SQL每日SQL计数器无法正常工作+ ChilliSpot-Max-Total-Octets

时间:2016-05-08 15:51:18

标签: radius freeradius coovachilli

我使用Freeradius + CoovaChilli + Nginx + Ubuntu。

我很好地配置了Freeradius,一切正常。除了ChilliSpot-Max-Total-Octets在Mac地址使用了1 117 000 000个八位字节后终止会话,但用户名可以再次登录。

我期待用户名在等待每日重置之前无法登录。

是否由于唯一ID会话?

/etc/freeradius/sql/mysql/counter.php



          sqlcounter chillispot_max_bytes {
            counter-name = ChilliSpot-Max-Total-Octets
            check-name = ChilliSpot-Max-Total-Octets
            reply-name = ChilliSpot-Max-Total-Octets
            reply-message = "C'est pas bien de trop télécharger !!"
            sqlmod-inst = sql
            key = User-Name
            reset = daily
            query = "SELECT SUM(AcctInputOctets) + SUM(AcctOutputOctets) FROM 

    radac$
        }

/ etc / freeradius / site-enabled / default


    Authorize
    {
    ...
            #
            # Counters for Chillispot
            #
            chillispot_max_bytes
            daily
    ...
    }

类似的第二个问题:

每日限制:我设置了一个完美的会话时间结束,但我希望每天都有OFF时间。


    sqlcounter dailycounter {
            counter-name = Daily-Session-Time
            check-name = Max-Daily-Session
            reply-name = Session-Timeout
            reply-message = "You've used up more than one hour today"
            sqlmod-inst = sql
            key = User-Name
            reset = daily


            # This query ignores calls that started in a previous
            # reset period and continue into into this one. But it
            # is a little easier on the SQL server
            query = "SELECT SUM(acctsessiontime) FROM radacct WHERE \
                    username = '%{%k}' AND acctstarttime > FROM_UNIXTIME('%b')"

    }

Dictionnary:


    $INCLUDE        /usr/share/freeradius/dictionary
    $INCLUDE        /usr/share/freeradius/dictionary.chillispot

    ATTRIBUTE       Max-Daily-Session        30011    integer
    ATTRIBUTE       chillispot_max_bytes    3010    integer

有什么想法吗?

我正在考虑创建一些用户组,但我不确定如何使用Radius来管理它。

谢谢

0 个答案:

没有答案