fw_rule
Manage OPNsense firewall filter rules and interface groups. Create, update, delete, toggle, list, and apply rule changes to control network traffic.
Instructions
Firewall filter rules, and the interface groups a rule can target so one rule covers several networks. Call action='help' for each action's fields and rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| log | No | [update] Log packets matched by this rule | |
| uuid | No | Record to act on, identified by a list action. | |
| apply | No | Apply now rather than leaving the change staged. The default differs by action; action='help' reports each one. | |
| descr | No | [set_group] descr | |
| quick | No | [update] Stop evaluating further rules on a match | |
| action | Yes | Operation to run. 'help' lists fields. | |
| confirm | No | Token returned by the previous call, to confirm. | |
| enabled | No | Target state, set explicitly rather than flipped. | |
| gateway | No | [create, update] gateway | |
| members | No | [set_group] Interface keys the group should contain, e.g. ['opt3', 'opt4']. This replaces the membership rather than adding to it. | |
| protocol | No | [create, list, update] protocol | any |
| direction | No | [create, update] direction | in |
| interface | No | [create, list, update] interface | lan |
| rule_uuid | No | [delete, toggle, update] UUID of the rule to delete | |
| ipprotocol | No | [create, update] ipprotocol | inet |
| source_net | No | [create, update] source_net | any |
| source_not | No | [update] Invert the source match | |
| description | No | Free-text note stored on the record. | |
| rule_action | No | [create, list, update] rule_action | pass |
| source_port | No | [create, update] source_port | any |
| interfacenot | No | [update] Invert the interface match | |
| destination_net | No | [create, update] destination_net | any |
| destination_not | No | [update] Invert the destination match | |
| destination_port | No | [create, update] destination_port | any |