Different bandwidth for Day & Night in FR

Alan DeKok aland at deployingradius.com
Wed Feb 7 15:30:09 CET 2018


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.




More information about the Freeradius-Users mailing list