Bandwidth restriction per user disabled on a schedule
-
Hello,
Currently I have a per-user bandwidth restriction (2000 Kbit/s, in upload and download) that is enabled on my captive portal. This limitation is valid 24 hours a day.
I would like this restriction disabled from 6:30 p.m. to 8 a.m.
There is no option in the captive portal configuration page to do this.
Could you help me ?
Thank you for your answers.
Cordially
-
@nicolas-pissard said in Bandwidth restriction per user disabled on a schedule:
would like this restriction disabled from 6:30 p.m. to 8 a.m.
There is no option in the captive portal configuration page to do this.
Could you help me ?
Thank you for your answers.i'm not going to help you with this (lack of time).
it's possible to create a php script, that runs with a cron, to modify the per-user-bw setting depending on time.
check the developer shell for more information on how to destroy your firewall :)
https://docs.netgate.com/pfsense/en/latest/development/php-shell.html -
@nicolas-pissard said in Bandwidth restriction per user disabled on a schedule:
There is no option in the captive portal configuration page to do this.
There is ! Visit the pfSense GUI, captive portal page, the setting you showed in the image, and remove the check on Per-user-bandwidth, and Save
But I understood that you wanted to do this automatically.
Schedules won't help you here, as they are meant to be used with GUI firewall rules.
Or, the captive portal rules uses pf firewall rules that are not visible in the GUI.I guess you can pull it of by writing your own PHP script file that 'sets' or 'resets' the "peruserbw" variable and then call the Save function.
Then a cron line (install the Cron pfSense package) set to run to "set" the variable at 8h00 and one cron line to reset it at 18h30.edit : @heper was typing faster ;)
extra info :
For every connected portal user, there is a limiter :
See GUI : Diagnostics > Limiter InfoThat is, there should be one limiter per user. A bug (using 22.05) will show just one limiter for all users, and that is plain wrong.
See 22.05 - CP clients have connectivity issues after x amount of time for info. -
Thank you for your answers.
When you talk about scripting, do you have a concrete example because I do not master development with Pfsense.
Thanks for your help.
-
@nicolas-pissard said in Bandwidth restriction per user disabled on a schedule:
concrete example
When you visit this page :
you are actually looking at this page :
or, to be more precise : a page (== a file) on a web server.
Here it is :
/usr/local/www/services_captiveportal.phpHave a look at this file.
It's PHP, worlds most easiest language - as simple as BASIC was in the eighties/nighties