Different bandwidth for Day & Night in FR

JAHANZAIB SYED aacable at hotmail.com
Thu Feb 8 18:34:26 CET 2018


Ok I made one script that runs on 8pm, and change bandwidth on the fly for users using RADCLIENT. so COA part is working fine,


but the problem is if user disconnects and re connect, then he again assigned his normal package.


Can i make some checks ? if user have 8pm-8am double speed pkg, then he should get pkg from different profile rather then its assigned profile?



<http:///>


________________________________
From: Freeradius-Users <freeradius-users-bounces+aacable=hotmail.com at lists.freeradius.org> on behalf of Alan DeKok <aland at deployingradius.com>
Sent: Wednesday, February 7, 2018 7:30 PM
To: FreeRadius users mailing list
Subject: Re: Different bandwidth for Day & Night in FR

On Feb 7, 2018, at 4:23 AM, JAHANZAIB SYED <aacable at hotmail.com> wrote:
>
> OS:
> Using Ubuntu / Freeradius for user authentication. NAS is mikrotik ver 6.x
>
> Scenario:
> I am trying to implement 'different bandwidth for day & night'
>
> from 8am-till-8pm > 1mb
> from 8pm-till-8am > 2mb

  Changing bandwidth on the fly can be difficult.

> I dont know much about freeradius inside core, therefore so far I have think of following,
>
> I have created separate table in which i have a dded username / bandwidth for night, start/end time / COA sent flag.
>
> mysql> select * from  users_bwsch;
> +----+----------+-----------+----------+----------+------------------+----------------+
> | id | username | bwpkg       | start    | end      | start_alert_sent | end_alert_sent |
> +----+----------+-----------+----------+----------+------------------+----------------+
> |  1 | zaib     | 2048k/2048k | 11:00:00 | 20:00:00 |                0 |              0 |
> +----+----------+-----------+----------+----------+------------------+----------------+
>
> I know howto use COA, but confused on howto do multiple IF statement in ACCOUNTING section

  There are lots of examples in the default configuration files.  Those should help.

> 1) Using UNLAG query in FR , check the start and end time and match with NOW, if time matches, & start_alert_coa flag is 0 then send COA and update start_alert_sent to 1, when time ends, send COA to change pkg to original one and set FLAG end_alert_sent to 1, and something more ...
>
> OR
>
> 2) Using external script to do the checking and send COA using radclient?

  Use an external script.  FreeRADIUS only does things when it receives a packet.  So if you want to do something at 8am and 8pm, and send CoA packets for 1000's of users, you'll need an external script.

  Alan DeKok.


-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


More information about the Freeradius-Users mailing list