OPNsense Forum

English Forums => General Discussion => Topic started by: just-a-guy on July 06, 2026, 09:17:32 PM

Title: captive portal enable/disable control
Post by: just-a-guy on July 06, 2026, 09:17:32 PM
I have a zone 0 that works fine. i am looking to disable the captive portal at a specific time and then enable it after 4 hours. I know i can configctl captive portal start/stop but the just stops and starts the service. is there an api call or something not in the documentation I may be missing.

long explination.
i have my kids ( vlan20 ) using the captive portal and freeradius for their daily time. works great and i whitelist my local services the kids can have unlimited access to interact with. 07:45 - school starts. I have a script on adguard that enables "school.txt" which blocks the clients "homelab-kids" from everything but the whitelisted domains i set which is my moodle and other educational sites. these other sites can not be whitelisted in opnsense because it accepts an IP or CIDR and since IPs change, it wont work. I want the captive portal to be disabled so it doesnt count against their freeradius time and adguard can handle the DNS lockdown and this allows me to embed things in moodle.

12:00 ( noon ) and the adguard filter switches off so the internet goes back to normal blocking of adult sites etc and here i would like to have the captive portal enable again so the kids would need to log in and go back to using their daily allowance.

I have wrote software to manage their portal login/logoff and manage vouchers. if their daily time is down to 45 seconds it will automatically log them out and quickly automatically uses a voucher they can earn for extra time in the queue. I can possible add to my software so in the morning it logs them out but then logs them back in with a "school" voucher that would run the length of the school day but i was hoping for an easier script/cron.hosting vouchers seems like a work around but feels sloppy.

I hope this makes sense and from reading the documentation I couldn't find the solution.