OPNsense Forum

English Forums => 24.7, 24.10 Legacy Series => Topic started by: jf5876 on July 31, 2024, 06:14:38 PM

Title: Sessions not dying when schedule deactivates
Post by: jf5876 on July 31, 2024, 06:14:38 PM
Hello,

I've blocked the kids network range with a schedule in the firewall schedules. What happens is that they are playing a game, the schedule goes off and they continue playing.

The options and reading I've done so far indicate this should work the way it was intended but does not seem to do so. I've seen others use Cron entries to drop those states or schedule a reboot when that timing goes off.

Am I doing something wrong?

Thanks,

JF
Title: Re: Sessions not dying when schedule deactivates
Post by: Monviech (Cedrik) on July 31, 2024, 06:44:20 PM
It blocks all new connections. Any existing connections (states) continue to work.

This has been like that since ancient times.

When I was little 20 years ago or so, I was playing MMOs and I could continue to play for 2-3 hours after the ancient router scheduled the offline time, since the states are still there.
Title: Re: Sessions not dying when schedule deactivates
Post by: jf5876 on July 31, 2024, 07:02:47 PM
Okay.

I've created a configd file to kill the states for the range in question.

/usr/local/opnsense/service/conf/actions.d/actions_closesessionsforrange.conf
--
[check]
command:/sbin/pfctl -k <range>/24 2>&1
parameters:
type:script
message:check closesessionsforrange
description: Close Sessions for Range <range>/24
--

I then inserted a cron entry through the menu for this.

Is there any reason this would not work?

Thanks,

JF