Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
22.7 Legacy Series
»
Edit firewall roles from shell
« previous
next »
Print
Pages: [
1
]
Author
Topic: Edit firewall roles from shell (Read 1012 times)
scratchcat
Newbie
Posts: 1
Karma: 0
Edit firewall roles from shell
«
on:
October 15, 2022, 05:51:58 pm »
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.
Logged
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: Edit firewall roles from shell
«
Reply #1 on:
October 17, 2022, 08:31:09 am »
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
Logged
Fright
Hero Member
Posts: 1777
Karma: 164
Re: Edit firewall roles from shell
«
Reply #2 on:
October 17, 2022, 05:28:16 pm »
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 ?
Logged
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: Edit firewall roles from shell
«
Reply #3 on:
October 18, 2022, 08:23:40 am »
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
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
22.7 Legacy Series
»
Edit firewall roles from shell