OPNsense Forum

English Forums => 25.1, 25.4 Production Series => Topic started by: Cuffs on April 23, 2025, 07:53:43 PM

Title: Automation/Filter broken?
Post by: Cuffs on April 23, 2025, 07:53:43 PM
Hi

I'm using filter automation, and while the toggle command seems to be executed, the rule doesn't seem to be really taken into use.
Version: OPNsense 25.1.5_5

Steps:
1, activate rule via API (interface based rule)
2, test rule -> not working
3, check rule is active in the GUI -> yes
4, search the rule in statistics/rules -> rule cannot be found
5, hit Apply button in Automation/Filter without changing anything else and test rule -> now it works
6, search the rule in statistics/rules -> now rule can be found

Anyone else noticed this or using filter automation successfully?

Cheers
Christian
Title: Re: Automation/Filter broken?
Post by: Cuffs on April 24, 2025, 08:16:24 PM
Figured it out.

This is actually how the API seems to work.
You can toggle rules on/off with: /api/filter/toggleRule/{uuid}/0 or 1

But this does not apply the change to the pf.
To achieve this one must: /api/filter/apply


Thought I'd post it here in case someone stumbles over this as well.
Title: Re: Automation/Filter broken?
Post by: Wolfspyre on April 25, 2025, 02:14:09 AM
on the one hand, that **KINDA** makes sense... (commit / stage -> apply ) 
because there's likely cases wherein one would want to batch several related-but-isolated alterations.... and apply them once....

and I agree that it's .... surprising if ya don't know about it...

is there any mention of this in the docs?
 
Title: Re: Automation/Filter broken?
Post by: EricPerl on April 25, 2025, 03:15:51 AM
It shouldn't that surprising given it's the way the GUI works in various places, in particular FW rules...