opnsense / plugins

OPNsense plugin collection
https://opnsense.org/
BSD 2-Clause "Simplified" License
832 stars 619 forks source link

os-freeradius sqlcounter option trough GUI #2954

Closed dimitrijp closed 2 years ago

dimitrijp commented 2 years ago

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe. Support of sqlconter configuration trough GUI.

Describe the solution you'd like A clear and concise description of what you want to happen. Im not an freeradius expert, so I apologize if the "feature" is already possible with current implementation. I think it would be nice if we could have accounting option, to have control of max daily, weekly and monthly session time for particular user. As I understand the freeradius docs this can be done with enabling/configuring sqlcounter. Prerequisite here is of course usage of mysql for database, that is already supported for configuration inside the plugin.

Describe alternatives you've considered Currently plugin supports Max-Daily-Session variable that works with captive portal only. Suggested alternative can be used for users that dont use captive portal.

Additional context Add any other context or screenshots about the feature request here.

mimugmail commented 2 years ago

I think this is already possible but there is no glue between Plugin and core services.

What exactly so you want to achieve

dimitrijp commented 2 years ago

Hi,, I would like to have an option that I can configure for each user maximum daily "on air" time. After the time limitation is reached eg. 1h in current day, the user is kicked out of Wifi, and unable to login till next day, when counter resets.

From the freeradius configuration point of view..i dont have the exact config needed yet for rlm_sqlcounter to work, so I cant exactly describe you the functionality from configuration point..I wil try to set this up on stand alone radius server and compare to os-freeradius config, and what needs to be configured, if this makes sense.

Thanks for looking into this..

mimugmail commented 2 years ago

This is usually done by vendor VSA .. like mikrotik etc. I need some more details as there is no generic approach for such a feature

dimitrijp commented 2 years ago

Maybee here is a better explanation; https://gist.github.com/nasirhafeez/6669b24aab0bda545f60f9da5ed14f25#sqlcounter

The access point for sure needs to handle/support Session-Timeout packet sent from radius server to disconnect the client.

mimugmail commented 2 years ago

Its already there https://github.com/opnsense/plugins/blob/master/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/mods-enabled-counter

https://github.com/opnsense/plugins/blob/master/net/freeradius/src/opnsense/service/templates/OPNsense/Freeradius/users#L6

dimitrijp commented 2 years ago

Yes..checked that..if you are referencing to setting up Max-Daily-Session value..I tried that..but nothing is sent from radius towards AP/NAS after time expires.....as I said..im still learning this radius part so bear with me :). I will try with some more tests. Thanks.

dimitrijp commented 2 years ago

im closing this since I couldn't make working config with standalone freeradius server, and I used workaround with captive portal where max daily session is working.