Home
Help
Search
Login
Register
OPNsense Forum
»
Archive
»
20.7 Legacy Series
»
[Solved] Using Api to toggle Firewall rules
« previous
next »
Print
Pages: [
1
]
Author
Topic: [Solved] Using Api to toggle Firewall rules (Read 6998 times)
dasbrow
Newbie
Posts: 4
Karma: 0
[Solved] Using Api to toggle Firewall rules
«
on:
January 10, 2022, 05:17:55 pm »
I have a firewall rule under firewall->Rules->Lan to block Roblox while my kids are doing online schooling. Works great if I enable /disable it via the GUI. Unfortunately I can't see the rule via api calls, I want to automate blocking non school sites during class times.
Ie:
curl -k -u "YouKnowNothing":"JonSnow"
https://192.168.254.249/api/firewall/searchRules
Returns:
{"rows":[],"rowCount":0,"total":0,"current":1}
or
curl -k -u "YouKnowNothing":"JonSnow"
https://192.168.254.249/api/firewall/getRule/UUID
Returns:
[]
No idea what I am missing here. Please help my sanity and give me guidance.
Thanks in advance.
EDIT: I can't upgrade to 21.x until the weekend.
«
Last Edit: January 11, 2022, 03:50:35 pm by dan@providecom.com
»
Logged
Fright
Hero Member
Posts: 1777
Karma: 164
Re: Using Api to toggle Firewall rules
«
Reply #1 on:
January 10, 2022, 08:53:10 pm »
https://forum.opnsense.org/index.php?topic=16943.0
?
Logged
dasbrow
Newbie
Posts: 4
Karma: 0
Re: Using Api to toggle Firewall rules
«
Reply #2 on:
January 11, 2022, 03:50:21 pm »
This solved everything. Greatly appreciated.
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
Archive
»
20.7 Legacy Series
»
[Solved] Using Api to toggle Firewall rules