Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Time based captive portal for kids internet?
« previous
next »
Print
Pages: [
1
]
Author
Topic: Time based captive portal for kids internet? (Read 774 times)
moritz
Newbie
Posts: 2
Karma: 0
Time based captive portal for kids internet?
«
on:
April 04, 2024, 09:48:00 am »
Hi,
I want to use the captive portal to restrict the online time of the kids network. Using the vouchers is working but solves only half of the problem.
I want to have a fixed time (say 2-5 pm) where the internet is available in the kids network ideally without using vouchers. Afterwards I want to extend the internet time sometimes by 45 min or 2x45 min etc by giving vouchers, but not on a daily basis.
Does anybody have an idea how to achieve this using OPNsense 24.1?
Thanks a lot.
Logged
chemlud
Hero Member
Posts: 2486
Karma: 112
Re: Time based captive portal for kids internet?
«
Reply #1 on:
April 04, 2024, 11:50:35 am »
Deliver IPs based on MAC of devices and have scheduled firewall rules for these IPs and the services (ports) you want to regulate. You can adjust the time for the schedules. Have an eye on the states after access expires, otherwise the party will last until states expire...
Logged
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare
felix eichhorns premium katzenfutter mit der extraportion energie
A router is not a switch - A router is not a switch - A router is not a switch - A rou....
Monviech (Cedrik)
Global Moderator
Hero Member
Posts: 1601
Karma: 176
Re: Time based captive portal for kids internet?
«
Reply #2 on:
April 04, 2024, 12:43:22 pm »
I remember vividly how I abused this state expiration as a teenager (without knowing what it is) because I could stay logged on in the MMORPG I was playing far after the schedule for internet expired. xD
Logged
Hardware:
DEC740
chemlud
Hero Member
Posts: 2486
Karma: 112
Re: Time based captive portal for kids internet?
«
Reply #3 on:
April 04, 2024, 06:31:10 pm »
...in pfsense I had a cron job one min after the FW expired (don't remember if scheduled allow or deny rules though...) that killed states for the specific IPs in question. Later that didn't work well and I established cron jobs to kill ALL states when rules expired.
Nowadays the scheduled rules for isolated IP are gone, kiddies grown up, but the cron jobs remind during nighttime frequently that IT'S LATE NOW, GO TO BED... :-D
PS: how-to for CRON job for state killing
https://forum.opnsense.org/index.php?topic=10740.msg49334#msg49334
...and nano is installed by default nowadays iirc.
«
Last Edit: April 04, 2024, 06:52:54 pm by chemlud
»
Logged
kind regards
chemlud
____
"The price of reliability is the pursuit of the utmost simplicity."
C.A.R. Hoare
felix eichhorns premium katzenfutter mit der extraportion energie
A router is not a switch - A router is not a switch - A router is not a switch - A rou....
moritz
Newbie
Posts: 2
Karma: 0
Re: Time based captive portal for kids internet?
«
Reply #4 on:
April 05, 2024, 01:40:58 pm »
Thanks for the input. I guess I will check if can create some cronjob based script magic with the API. Found some captive portal API interaction here:
https://ask.linuxmuster.net/t/opnsense-captive-portal-per-api-steuern-reloaded-howto/9590
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Time based captive portal for kids internet?