unifi_create_firewall_policy
Create a zone-based firewall policy to allow, block, or reject traffic between zones; changes reaching protected networks only preview until you confirm.
Instructions
Create a zone-based firewall policy (official POST /firewall/policies), zones by name. Easy unless it can reach a protected network; then it needs confirm: true and previews first. A side that is a zone alone reaches every network in it, and UniFi's Internal zone holds every LAN. So a policy on a zone holding a protected network (UNIFI_MCP_PROTECTED_NETWORKS, pi-cluster by default) is confirm-level unless its filters provably exclude it: a NETWORK filter naming only other networks the console has, or IPv4 addresses, ranges or subnets (directly or through an IPv4 traffic matching list) outside the protected subnets. Addresses that overlap a protected subnet are confirm-level in any zone. Anything the guard cannot place leans to confirm: an unknown zone, list or network id, an IPv6 address, an opposite match, or a MAC, port or other filter, which counts as the whole zone.
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>",
"action": "<action>",
"source": "<source>",
"destination": "<destination>"
},
"name": "unifi_create_firewall_policy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Policy name | |
| site | No | Site name, id or reference; optional while the console has a single site | |
| action | Yes | What matched traffic gets | |
| source | Yes | Where the traffic comes from | |
| confirm | No | Must be true to carry out a guarded change; without it the tool only previews it | |
| enabled | No | Whether the policy is active | |
| schedule | No | Official schedule, e.g. {mode: EVERY_DAY, ...}; absent: always | |
| ipVersion | No | IP versions matched | IPV4_AND_IPV6 |
| description | No | Description | |
| destination | Yes | Where the traffic goes | |
| ipsecFilter | No | IPsec match | |
| loggingEnabled | No | Send matches to syslog | |
| protocolFilter | No | Official protocol filter, e.g. {type: NAMED_PROTOCOL, protocol: {name: TCP}, matchOpposite: false} or {type: PRESET, preset: {name: TCP_UDP}} | |
| allowReturnTraffic | No | ALLOW only: also allow the return traffic (default false) | |
| connectionStateFilter | No | Connection states matched (absent: all) |