set_fw_rule
Modify any field of an existing OPNsense firewall rule, such as interface, protocol, source/destination, action, or enable/disable status, with optional immediate application.
Instructions
Edit fields of an existing firewall rule
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rule_uuid | Yes | UUID of the rule to edit (from fw_rules output) | |
| description | No | New rule description | |
| interface | No | Network interface (e.g. 'lan', 'wan', 'opt1') | |
| direction | No | 'in' or 'out' | |
| ipprotocol | No | 'inet' (IPv4) or 'inet6' (IPv6) | |
| protocol | No | Protocol: 'any', 'tcp', 'udp', 'icmp', etc. | |
| source_net | No | Source network/IP (e.g. 'any', '192.168.1.0/24') | |
| source_port | No | Source port or 'any' | |
| destination_net | No | Destination network/IP | |
| destination_port | No | Destination port or 'any' | |
| action | No | 'pass', 'block', or 'reject' | |
| enabled | No | Enable or disable the rule | |
| gateway | No | Gateway for policy routing | |
| apply | No | Apply changes immediately (default: true) |