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

    Disable Captive Portal by schedule

    Scheduled Pinned Locked Moved Captive Portal
    5 Posts 4 Posters 5.6k 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.
    • W
      wahmed
      last edited by

      I want to do somewhat opposite of what most people ask on this form.  I want the captivate portal to be disabled during working hours and then enable it afterwards.

      Can this be done within pfsense or do i need something via crontab?  For me a simple option will be enable/disable the captive portal via command line.  What would the command be (if any).

      What is the better option via firewall schedule (and associated rule) or crontab?

      1 Reply Last reply Reply Quote 0
      • A
        abdurrahman
        last edited by

        you should first install the cron package

        the shell command to stop captive portal is as below:
        /sbin/kldunload ipfw.ko

        the shell command(s) to start captive portal is as below:
        /sbin/kldload ipfw.ko
        /sbin/ipfw -q /tmp/ipfw.cp.rules

        you should create 2 cron job. the first cron job is to start captive portal….the second cron job is to stop the captive portal

        1 Reply Last reply Reply Quote 0
        • W
          wahmed
          last edited by

          Thanks.  I have couple of followup questions.

          1. How does ipfw work/stack with pf?  How does one firewall take precedence over the other because as i understand with captive port both firewalls/filters are active?  Do they work at different layers?

          2)  Why would i need to unload a kernel module to disable ipfw instead of perhaps flushing the firewall table with "ipfw" or corresponding command?

          Regards,

          1 Reply Last reply Reply Quote 0
          • E
            eri--
            last edited by

            It is better to use the php commands to do the disable rather than the not correct shell commands provided here.
            Take a look at what happens when you click enable/disable button on the CP configuration page.

            1 Reply Last reply Reply Quote 0
            • R
              rjcrowder
              last edited by

              @ermal:

              It is better to use the php commands to do the disable rather than the not correct shell commands provided here.
              Take a look at what happens when you click enable/disable button on the CP configuration page.

              Another easy way to do it would be tojust leave captive portal running and insert/remove a rule (using the IPFW command) to skip the portal rules.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.