Question about SQLcounter and reject sessions

Andres Gomez Ruiz andres.gomez at
Wed Aug 8 15:34:30 CEST 2012

Hi everybody!!

I have been using Freeradius as AAA of some wireless hotspots and it works

After reading the Rlm_sqlcounter wiki page I started to use it, and it also
works great. This is the code of my sqlcounters:

sqlcounter dailycounter {

        counter-name = Daily-Session-Time

        check-name = Max-Daily-Session

        reply-name = Session-Timeout

        sqlmod-inst = sql

        key = User-Name

        reset = daily
        query = "SELECT SUM(acctsessiontime) FROM radacct  WHERE \
        username='%{%k}' AND acctstarttime > FROM_UNIXTIME('%b')"

sqlcounter noresetcounter {
        counter-name = Max-All-Session-Time
                check-name = Max-All-Session
                sqlmod-inst = sql
                key = User-Name
                reset = never
               query = "SELECT (UNIX_TIMESTAMP( NOW() ) -


Everything works fine, but now I have a question about the dailycounter:
I have some users that I need to reject their sessions at midnight, because
of that Im using the dailycounter... but I need that user can't login again
(the user is valid only 1 day).
In this moment the user can login again the next day. How can I do to
invalid the user after midnight?

An example of an user:

radcheck table
username: user1
User-Password :=""

radusergroup table
username: user1
groupname: 1day

radusergroup table
groupname: 1day
Max-Daily-Session := 12000

Thanks a lot!!

**Andres Gomez*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Freeradius-Users mailing list