Edit firewall roles from shell

Started by scratchcat, October 15, 2022, 05:51:58 PM

Previous topic - Next topic
Good day. Is it possible to manage firewall rules from the console?
Unfortunately I have access only from the console and I need to add/change a rule for vpn to get access to the web terminal.

It's unfortunately a complex task that nobody has ever tried to achieve in console code (to my knowledge). It's also a part that has static PHP files which means there is no API to leverage.


Sorry,
Franco

Hi
if its just a single emergency case and not a "regular manage approach" then i think you can add your rule to the /tmp/rules.debug, then  'pfctl -f /tmp/rules.debug', then add you rules via GUI ?

Not sure about "rules" vs. "roles" here. At least for rules there is the firewalll API plugin which might work with powershell script if you need something console-based.


Cheers,
Franco