Terminate dsl ppp sessions daily
Hi list, we use freeradius for our dsl user authentication. We want to disconnect some users via radius at fixed times, e.g. 04:00 am. Which attribute and value should / can i use? Session-Timeout doesnt do the job. Regards, Volker Lieder
On 14 Oct 2013, at 15:52, Volker Lieder <v.lieder@uvensys.de> wrote:
Hi list,
we use freeradius for our dsl user authentication.
We want to disconnect some users via radius at fixed times, e.g. 04:00 am.
Which attribute and value should / can i use?
Session-Timeout doesnt do the job.
Calculate time difference between now at 04:00am and insert it into Session-Timeout? If your NAS doesn't implement Session-Timeout then you can use CoA/DM or SNMP. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
Hi, we tried to calculate it via expr. How would you calculate it? Regards, Volker Am 14.10.2013 um 17:03 schrieb Arran Cudbard-Bell:
On 14 Oct 2013, at 15:52, Volker Lieder <v.lieder@uvensys.de> wrote:
Hi list,
we use freeradius for our dsl user authentication.
We want to disconnect some users via radius at fixed times, e.g. 04:00 am.
Which attribute and value should / can i use?
Session-Timeout doesnt do the job.
Calculate time difference between now at 04:00am and insert it into Session-Timeout?
If your NAS doesn't implement Session-Timeout then you can use CoA/DM or SNMP.
Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi, we already tried expiration, but it doesnt work like we need it. Have you an example what the value or config should look like? Regards, Volker Am 14.10.2013 um 17:55 schrieb Arran Cudbard-Bell:
On 14 Oct 2013, at 16:27, Volker Lieder <v.lieder@uvensys.de> wrote:
Hi, we tried to calculate it via expr.
How would you calculate it?
Pretty sure the expiration module does exactly this.
Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Hi, we tried this fix setting: Expiration := October 15 2013 13:45:00 is working, but we want to use an attribute/value in mysql, which calculates the session timeout/expiration from login of the account until tomorrow, 04:00 am, where tomorrow is a variable, too. Regards, Volker Am 15.10.2013 um 13:49 schrieb Alan DeKok:
Volker Lieder wrote:
we already tried expiration, but it doesnt work like we need it.
"Hi, we tried stuff and it doesn't work".
That's useful.
Have you an example what the value or config should look like?
Maybe doc/rlm_expiration would help.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Am Dienstag, 15. Oktober 2013, 14:45:53 schrieb Volker Lieder:
Hi,
we tried this fix setting:
Expiration := October 15 2013 13:45:00
is working,
but we want to use an attribute/value in mysql, which calculates the session timeout/expiration from login of the account until tomorrow, 04:00 am, where tomorrow is a variable, too.
As already posted in this thread, use the expiration module. Calculate the expiration time dynamically from time NOW until 4:00 on the next morning. FreeRADIUS can set attributes on the fly as the packed is authorized. -- Mit freundlichen Grüßen, Michael Schwartzkopff -- [*] sys4 AG http://sys4.de, +49 (89) 30 90 46 64, +49 (162) 165 0044 Franziskanerstraße 15, 81669 München Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
Hi, we try to calculate it via sql statement and other stuff, like this: For Expiration: %{sql:select (TIMESTAMPADD(HOUR, 4, TIMESTAMPADD(DAY, 1, CURDATE())))} For Session-Timeout direct: %{(exp:$(date +%s --date="next day 04:00:00") - $(date +%s)} but dont find the right way, how to add this to specific users or as an attribute of a group. If its so easy, why dont easily send back the solution? And believe, i googled and read a lot ;-) Am 15.10.2013 um 15:21 schrieb Michael Schwartzkopff:
Am Dienstag, 15. Oktober 2013, 14:45:53 schrieb Volker Lieder:
Hi,
we tried this fix setting:
Expiration := October 15 2013 13:45:00
is working,
but we want to use an attribute/value in mysql, which calculates the session timeout/expiration from login of the account until tomorrow, 04:00 am, where tomorrow is a variable, too.
As already posted in this thread, use the expiration module. Calculate the expiration time dynamically from time NOW until 4:00 on the next morning.
FreeRADIUS can set attributes on the fly as the packed is authorized.
-- Mit freundlichen Grüßen,
Michael Schwartzkopff
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64, +49 (162) 165 0044 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Volker Lieder wrote:
we try to calculate it via sql statement and other stuff, like this:
For Expiration: %{sql:select (TIMESTAMPADD(HOUR, 4, TIMESTAMPADD(DAY, 1, CURDATE())))}
For Session-Timeout direct: %{(exp:$(date +%s --date="next day 04:00:00") - $(date +%s)}
That works.
but dont find the right way, how to add this to specific users or as an attribute of a group.
You just add it as an attribute and value. The server takes care of expanding it. In the radreply table, just put: Expiration := "%{sql:select (TIMESTAMPADD(HOUR, 4, TIMESTAMPADD(DAY, 1, CURDATE())))}" It *really* is that easy.
If its so easy, why dont easily send back the solution?
Because it's already documented. See "man unlang". Attributes have names and values. If you put %{...} into a value, it's expanded automatically. (With some caveats... see the documentation).
And believe, i googled and read a lot ;-)
I don't really see what the problem is. The configs, documentation, and examples do a lot of dynamic expansion, like above. Just follow the examples. Alan DeKok.
Hi, we solved it with this sql query: mysql> select attribute,op,value from radgroupreply where groupname = '_4Uhr-Trennung' ; +-----------------+----+------------------------------------------------------------------------------------------------------------------+ | attribute | op | value | +-----------------+----+------------------------------------------------------------------------------------------------------------------+ | Session-Timeout | := | `%{sql:select (UNIX_TIMESTAMP(TIMESTAMPADD(HOUR, 4, TIMESTAMPADD(DAY, 1, CURDATE())))) - UNIX_TIMESTAMP(NOW())}` | | Fall-Through | := | YES | +-----------------+----+------------------------------------------------------------------------------------------------------------------+ If you have any other solutions, please let us know ;-) Regards, Volker Am 15.10.2013 um 15:21 schrieb Michael Schwartzkopff:
Am Dienstag, 15. Oktober 2013, 14:45:53 schrieb Volker Lieder:
Hi,
we tried this fix setting:
Expiration := October 15 2013 13:45:00
is working,
but we want to use an attribute/value in mysql, which calculates the session timeout/expiration from login of the account until tomorrow, 04:00 am, where tomorrow is a variable, too.
As already posted in this thread, use the expiration module. Calculate the expiration time dynamically from time NOW until 4:00 on the next morning.
FreeRADIUS can set attributes on the fly as the packed is authorized.
-- Mit freundlichen Grüßen,
Michael Schwartzkopff
-- [*] sys4 AG
http://sys4.de, +49 (89) 30 90 46 64, +49 (162) 165 0044 Franziskanerstraße 15, 81669 München
Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (4)
-
Alan DeKok -
Arran Cudbard-Bell -
Michael Schwartzkopff -
Volker Lieder