Check which firewall policy applies
unifi_check_firewall_pathSimulate a new source-to-destination connection to get the zone-based firewall verdict (ALLOW, BLOCK, or REJECT) from ordered policies, including uncertain first matches; no traffic is sent.
Instructions
Read-only "what if": for a new connection from source to destination (and destination port), work out the source and destination zones from the networks' subnets (addresses outside every local subnet are in the External zone), then walk the enabled zone-based firewall policies between those zones in index order and report the first that matches, so the verdict (ALLOW, BLOCK or REJECT). Policies that might match first but can't be evaluated from addresses (apps, domains, regions, IP or port groups, schedules) are listed under may_match_first, and when one of them is listed the verdict is only certain if it doesn't match. Traffic rules that match the source and destination are listed too. It reads the configuration only: no traffic is sent, and the controller's own evaluation can differ in details. Network 9.0+ (zone-based firewall).
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": {
"source": "<source>",
"destination": "<destination>"
},
"name": "unifi_check_firewall_path"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | Destination port (tcp/udp). Without it, policies that match specific ports are reported as may_match_first. | |
| site | No | Site name/ID as used in the API (e.g. 'default'). Defaults to the configured site. See unifi_list_sites. | |
| source | Yes | Source IP address, or the MAC address of a connected client | |
| protocol | No | Protocol (default tcp) | |
| destination | Yes | Destination IP address, or the MAC address of a connected client | |
| source_zone_id | No | Use this zone for the source instead of working it out (v2 _id from unifi_list_firewall_zones), e.g. the Gateway zone | |
| destination_zone_id | No | Use this zone for the destination instead of working it out, e.g. the Gateway zone for the gateway's own services |