OPNsense Forum

Archive => 23.1 Legacy Series => Topic started by: pablo on April 29, 2023, 06:47:29 PM

Title: Solved - Blocking established connections?
Post by: pablo on April 29, 2023, 06:47:29 PM
Hi,

I've set up a single, scheduled IP blocking rule on my LAN.  It works for new connections but it does not block an established connection.

I tried with and without Firewall > Settings > Advanced > Schedule States checked.

How would I go about blocking established connections?

I've searched the forum and I didn't get any hits.  It's possible that my searching -fu isn't all that great.  :\

Thx!
Title: Re: Blocking established connections?
Post by: cookiemonster on April 29, 2023, 10:51:10 PM
Firewall > Diagnostics > States | Actions : Reset state table
But it resets all connections, not just the ones you might want new rules to apply as far as I can see. I think there has been discussion of it in the past but right now is an action on all connections.
Title: Re: Blocking established connections?
Post by: pablo on April 29, 2023, 11:14:42 PM
Thx!  Any way to make it programmatic?  I suppose I could try a curl/cron from another machine....

Edits

I should have done a better search.  I found how to do it via the CLI:

/sbin/pfctl -F state

For others, here's the source of the above and how to automate it:

https://forum.opnsense.org/index.php?topic=10740.0