firewall_rule_add
Adds an OpenWrt traffic rule with preview-first changes, applying only after confirmation and auto-rolling back if the router stops responding.
Instructions
Add a traffic rule. src/dest: zone names or "*" (dest omitted = traffic to the router itself). target: ACCEPT, REJECT or DROP. proto: tcp, udp, "tcp udp", icmp or all. family: ipv4, ipv6 or any. Without confirm=true this only returns a preview of the UCI changes and changes nothing. With confirm=true it applies them with the router's rollback timer, checks the router still answers, and confirms; if the check fails, the router restores the old config by itself.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"src": "<src>"
},
"name": "firewall_rule_add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| src | Yes | ||
| dest | No | ||
| name | Yes | ||
| proto | No | tcp udp | |
| family | No | any | |
| src_ip | No | ||
| target | No | ACCEPT | |
| confirm | No | ||
| dest_ip | No | ||
| enabled | No | ||
| dest_port | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||