update_firewall_rule
Modify an existing UniFi firewall rule by specifying its ID and the fields to change. Only provided attributes are updated and applied instantly.
Instructions
Update a legacy firewall rule. Only provided fields are changed.
Mutating operation: applied immediately and persisted on the controller. Use get_firewall_rules to find the rule ID first.
Args: rule_id: Firewall rule ID (from get_firewall_rules) name: New rule name action: Action — "accept", "drop", or "reject" protocol: Protocol — "tcp", "udp", "icmp", "all", or IANA number dst_port: Destination port or range src_zone: Source zone ID dst_zone: Destination zone ID src_port: Source port or range logging: Enable/disable logging enabled: Enable/disable the rule site: Site to operate on. Defaults to "default". device: Optional console name to target a specific console; omit for default.
Returns: Updated firewall rule configuration
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | New rule name. | |
| site | No | Site to operate on. Defaults to "default". | default |
| action | No | Action — "accept", "drop", or "reject" | |
| device | No | Optional console name to target a specific UniFi device; omit for default. | |
| enabled | No | Enable/disable the rule. | |
| logging | No | Enable/disable logging. | |
| rule_id | Yes | Firewall rule ID (from get_firewall_rules). | |
| dst_port | No | Destination port or range. | |
| dst_zone | No | Destination zone ID. | |
| protocol | No | Protocol — "tcp", "udp", "icmp", "all", or IANA number | |
| src_port | No | Source port or range. | |
| src_zone | No | Source zone ID. |