coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
514 stars 257 forks source link

Coova-Chilli / radius disconnect Problem #506

Open disem1 opened 4 years ago

disem1 commented 4 years ago

Hi,

i use two counter in my freeradius:

The "normal" Expire-After-Initial-Login and the Total-Max-Octets:

sqlcounter foreverbitscounter { counter-name = Total-Max-Octets check-name = ChilliSpot-Max-Total-Octets reply-name = ChilliSpot-Max-Total-Octets sqlmod-inst = sql key = User-Name reset = never query = "SELECT (SUM(AcctInputOctets)+-SUM(AcctOutputOctets)) FROM radacct WHERE UserName='%{%k}'" }

The Counter works fine if i manually logoff from hotspot and connect again. But if the Client stay online the ongoing session dont get disconnected.

For Example: Expire-After := 3600 Seconds

The Client can be online until he shutdown his pc, or disonnect the wlan (or somethin else).

But if i disconnect with 10.1.0.1:3990/logoff and reconnect after 3601 it works and i cant reconnect with the same tickets.

Sorry for my bad english.

Thanks!

imranniaz commented 4 years ago

Where you defined "Expire-After := 3600 Seconds", did you put it in radcheck table along with username?

disem1 commented 4 years ago

Unbenannt

Yes, with username. If i disconnect manually i have no problems (the expiry time get accepted). But when i create a ticket with for example 3600 seconds. I can stay online without an disconnect.

imranniaz commented 4 years ago

It depends on how you calculate the Expire-After period. and what you reply for this counter.

disem1 commented 4 years ago

Thank you!

sqlcounter expire_on_login { sql_module_instance = sql dialect = mysql

    counter_name = Expire-After-Initial-Login
    check_name = Expire-After
    key = User-Name
    reset = never      
    query = "\
          SELECT IFNULL( MAX(TIME_TO_SEC(TIMEDIFF(NOW(), acctstarttime))),0) \
          FROM radacct \
          WHERE UserName='%{${key}}' \
          ORDER BY acctstarttime \
          LIMIT 1;"

}

I use a counter like this, how can i set a reply?

imranniaz commented 4 years ago

add reply as:

reply-name = Session-Timeout