Captive Portal - Enable / Disable by Schedule or Cron



  • Hi!

    Can I Disable or Enable my captive portal by schedules or cron ?

    I need all time by captive portal, authenticated by vounchers, except 12:00 13:00 captive portal disabled.

    My captive portal is working, but i need disable/enable midday.

    Any ideas?

    Thanks



  • When you disable the portal, all traffic passes through.
    You want to implement some happy hours ?
    And what to do with the existing connections ?



  • you can create a script with

    ipfw add 10 allow ip from any to any keep-state
    

    and anotheer script with

    ipfw delete 10
    

    and use cron to launch it at specified time



  • Yess!!! It Works!!

    Here my scripts ;

    81732294-b384-4ee8-b055-12e760915253-image.png

    File: disable_captive.sh

    #!/bin/sh

    ipfw add 10 allow ip from any to any keep-state

    File: enable_captive.sh
    #!/bin/sh

    ipfw delete 10

    Now at Cron ;

    11:45 AM Captive Portal Ignored. All traffic passes through.
    13:00 PM Captive Portal Enabled, rule 10 deleted.

    981cd0f7-c66c-44a3-bf64-cf0993605764-image.png

    Tomorow I'll see if really works fine!

    Thanks @kiokoman and @Gertjan


Log in to reply