Error deleting states with the API killStates function?

Started by ckishappy, August 12, 2021, 11:01:50 PM

Previous topic - Next topic
Hi, I try to kill states after enabling some filter rules to stop the (established) connections immediately. This is to turn-off the internet / TV for the kids immediately. I integrate this an on-off switch in HomeKit (via node-red)...

I use the below curl Post killStates command:

curl -k -u "$KEY":"$SECRET" -X POST "https://opnsenseIP/api/diagnostics/firewall/killStates" -d ""


Error message I get is as following:
{"result":"failed"}%     

The question is: How can I kill the states (via the API) for a specific destination or source ip/alias?




hmm, the only thing that I got to work is the following one:

have a shell script logging to the firewall with SSH in and execute in the CLI:

sudo pfctl -k 192.168.1.0/24

Seems to be the brute force method to kill all states for the LAN (in the above case 192.168.1.0/24). 

Perhaps someone in the forum knows more on the killStates API, and how to include Alias?

...no idea of API, but I use a cron job (killing all states...)

https://forum.opnsense.org/index.php?topic=10740.0
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....