Disable Captive Portal by schedule
-
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?
-
you should first install the cron package
the shell command to stop captive portal is as below:
/sbin/kldunload ipfw.kothe shell command(s) to start captive portal is as below:
/sbin/kldload ipfw.ko
/sbin/ipfw -q /tmp/ipfw.cp.rulesyou should create 2 cron job. the first cron job is to start captive portal….the second cron job is to stop the captive portal
-
Thanks. I have couple of followup questions.
- 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,
-
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. -
@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.