How to enable/disable existing firewall rules? #484
-
|
Hello. Thank you for creating this awesome project. How do I enable/disable an existing fw rule via pfsense-api? Nothing changed on the pfSense web UI after successful requests. Did I misunderstood anything? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
|
Looks like you are using After running, the rule now shows as disabled: |
Beta Was this translation helpful? Give feedback.
-
|
How will this work on V2? This seems not work: result: |
Beta Was this translation helpful? Give feedback.
-
|
Hello, I am working on migrating from v1 to v2 after updating pfsense to 2.8 and realized that v1 is not supported... In v1 I was able to enable / disable firewall rules using the tracking ID. In v2 it seems that I have to use an ID, which is not presistent. Is there an easy way to get this ID based on the Tracking ID or I will have to always start with querying all the rules and find the ID based on the tracking ID? Also in v1 i was able to use 'apply': true to apply the change directly. Does this work under v2 or I will have to call the /api/v2/firewall/apply endpoint to make the change? Thanks |
Beta Was this translation helpful? Give feedback.

Looks like you are using
disablein your request body instead ofdisabled. Here's an example curl request I just used for disabling an existing firewall rule:After running, the rule now shows as disabled: