• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Bandwidth restriction per user disabled on a schedule

Scheduled Pinned Locked Moved Captive Portal
5 Posts 3 Posters 721 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N
    nicolas.pissard
    last edited by Sep 19, 2022, 8:56 AM

    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.

    9ef49c5c-43b0-49c9-a8f6-61e87b1dc6df-image.png

    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

    H G 2 Replies Last reply Sep 19, 2022, 9:29 AM Reply Quote 0
    • H
      heper @nicolas.pissard
      last edited by heper Sep 19, 2022, 9:31 AM Sep 19, 2022, 9:29 AM

      @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

      1 Reply Last reply Reply Quote 0
      • G
        Gertjan @nicolas.pissard
        last edited by Gertjan Sep 19, 2022, 9:39 AM Sep 19, 2022, 9:33 AM

        @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 Info

        That 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.

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • N
          nicolas.pissard
          last edited by Sep 19, 2022, 10:35 AM

          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.

          G 1 Reply Last reply Sep 19, 2022, 10:50 AM Reply Quote 0
          • G
            Gertjan @nicolas.pissard
            last edited by Sep 19, 2022, 10:50 AM

            @nicolas-pissard said in Bandwidth restriction per user disabled on a schedule:

            concrete example

            When you visit this page :

            59b09b08-28c5-4ba6-9539-09dee14b4209-image.png

            you are actually looking at this page :

            395df406-5b60-4c6f-8a46-bf76ab97dfae-image.png

            or, to be more precise : a page (== a file) on a web server.
            Here it is :
            /usr/local/www/services_captiveportal.php

            Have a look at this file.
            It's PHP, worlds most easiest language - as simple as BASIC was in the eighties/nighties 😊

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 0
            5 out of 5
            • First post
              5/5
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
              This community forum collects and processes your personal information.
              consent.not_received