OPNsense Forum

English Forums => General Discussion => Topic started by: pickone on May 28, 2025, 03:31:58 PM

Title: Enable/Disable Port Forwarding rule through API
Post by: pickone on May 28, 2025, 03:31:58 PM
Hi!

Anyone knows how to do this in the latest OPNsense version?
I have tried so many things but none worked...

First of all, I need to get the uuid of that port forwarding rule, which I don't know how to get it. I found something in two places, but both were different...
Then, trying with togglerule or toggle_rule, with both of the uuid's found, stil not working.

Any idea?

Thanks!
Title: Re: Enable/Disable Port Forwarding rule through API
Post by: Monviech (Cedrik) on May 28, 2025, 03:57:11 PM
The port forwarding does not have an API endpoint yet.

https://docs.opnsense.org/manual/firewall_automation.html

https://docs.opnsense.org/development/api/core/firewall.html
Title: Re: Enable/Disable Port Forwarding rule through API
Post by: pickone on May 28, 2025, 07:29:19 PM
Ahhh... :-(