Remotely enable / disable a rule

Started by Ulrar, May 10, 2020, 05:35:58 PM

Previous topic - Next topic
Hi,

Is there any way, either through API or SSH or anything else, to have an external system enable or disable an existing firewall rule ?
I have a rule to send my TV's traffic through a VPN (for geo locked content) and I'd like to be able to quickly toggle it on or off from home assistant, I was thinking of just writing a script but it looks like the API doesn't expose anything outside of aliases for the firewall.

Is there any other way to get it to work ?

Thank you

Haven't played with it myself, but looks like there's a os-firewall plugin "Firewall API supplemental package" and looking at the docs ( https://docs.opnsense.org/development/api/plugins/firewall.html ) it seems that there's a command for toggling a rule.