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 641 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

      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 GertjanG 2 Replies Last reply Reply Quote 0
      • H
        heper @nicolas.pissard
        last edited by heper

        @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
        • GertjanG
          Gertjan @nicolas.pissard
          last edited by Gertjan

          @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

            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.

            GertjanG 1 Reply Last reply Reply Quote 0
            • GertjanG
              Gertjan @nicolas.pissard
              last edited by

              @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
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.