/unifi:unifi-firewallfrom unifi
Guides through UniFi zone-based firewall: why rest/firewallrule returns empty, where policies live, the block-by-default trap on new zones, and lockout safety. For network segmentation, VLAN isolation, and IoT device blocking.
Ships in unifi. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Modern UniFi Network replaced the old LAN-IN / LAN-LOCAL / WAN-IN rule groups with a zone-based firewall. Every network belongs to a zone, and policies govern traffic between zone pairs rather than between interfaces. This is a better model and a worse migration, because the old API endpoint still exists and still answers.
udm raw GET /proxy/network/api/s/default/rest/firewallrule
# []
An empty array. The endpoint is alive, authenticated, and lying by omission: on a zone-based controller your rules are not there. They are here:
udm policies # GET /proxy/network/v2/api/site/default/firewall-policies
udm zones # GET /proxy/network/v2/api/site/default/firewall/zone
An agent that reads rest/firewallrule, sees [], and concludes the network is
unfirewalled will confidently propose rebuilding rules that already exist. If a
gateway reports zero firewall rules and it is clearly not wide open, you are on
the wrong endpoint.
The zone endpoint is singular. /firewall/zone works, /firewall/zones
404s. There is no reason for this; just remember it.
The single most expensive thing to learn the hard way.
Creating a new custom zone auto-generates default policies, and the Internal↔zone pair defaults to BLOCK in both directions. External and Gateway pairs default to allow, and custom→External allows, so the new zone reaches the internet fine. What it loses, instantly and completely, is the trusted LAN: DNS resolvers, the media server, the home-automation hub, the NAS.
The failure mode is nasty because it is partial. Devices still have internet. They still associate, still pull DHCP, still look healthy in the controller. They just cannot resolve names against your internal resolver, so everything degrades ten seconds later in a way that reads like a DNS outage.
Stage the allow policies before you create the zone. Have the payloads written and ready to POST, create the zone, then immediately POST the allows. Do not create a zone at the end of a session, and do not create one for a segment containing anything you or your household will notice going down.
If you are already in the hole: the zone exists, its devices are cut off, and the
fix is POSTing allow policies to firewall-policies for the Internal→zone and
zone→Internal directions.
The common goal. Two custom zones, each with a deliberately small hole punched back into the trusted network.
IoT zone. Cheap devices with vendor cloud dependencies. They need the internet, they need the gateway, and they need a very short list of internal services:
Camera zone. Cameras are the segment most worth isolating and the easiest, because a locally-recorded camera needs almost nothing:
Order matters within a zone pair, same as any firewall. Put the narrow allows above the broad block.
If you also run per-device rules (a smart TV blocked from ad domains, a bedtime schedule on a game console) note that rules written against the Internal zone do not follow a device when you move it to a custom zone. Mirror them into the new zone, or the schedule you set up last year quietly stops applying.
# List, and find the one you mean
udm policies --json | python3 -c '
import json,sys
for p in json.load(sys.stdin):
print(p["_id"], p.get("action"), p.get("name"))'
# Create
udm policies create '{...}'
# Update: GET the policy, modify, PUT the whole object back
udm policies update <POLICY_ID> '{...full object...}'
udm policies delete <POLICY_ID>
Build a payload by reading an existing policy of the same shape and editing it. The schema is undocumented and version-specific; a policy the controller wrote itself is the most reliable template you will find.
v2 PUTs may return HTTP 201 instead of 200. That is success. Do not retry.
action takes ALLOW, BLOCK or REJECT. BLOCK drops silently; REJECT
answers (ICMP port-unreachable for UDP), so the client gives up at once instead of
waiting for a timeout. Use REJECT when you want software to fall back, the classic
case being QUIC: a dropped UDP 443 leaves browsers and apps retrying QUIC before
they fall back to TCP, which reads as "the internet is slow". For that, match
protocol: "udp" with destination port: "443" rather than the QUIC DPI app:
an app match only fires after DPI has classified the flow, so the first packets
get through and the rejection arrives late. Scope it: UDP 443 is not only
QUIC. A blanket rule also breaks DTLS VPNs (Cisco AnyConnect, GlobalProtect),
OpenVPN on UDP 443 and some WebRTC/TURN calls, so limit it by source zone or device
group, or exclude known VPN endpoints. Test it from a client: connecting a UDP socket
sends nothing, so connect, send a datagram, then receive; the receive (or the next
send) should fail with "connection refused" within milliseconds. A bare connect()
succeeding proves nothing. (Verified 2026-10-22, Network 11.0.83.)
Verify from a fresh GET, never from the PUT response. Re-read the policy list and confirm the rule is present, enabled, in the position you expect, and in the zone pair you expect.
You are configuring the device your management traffic flows through. A firewall mistake here does not throw an error, it removes your ability to fix the error.
udm policies --json > policies-$(date +%F).json costs
nothing and is the difference between a rollback and an archaeology project.What SKILL.md sets; muted values are Claude Code's defaults
5 skills in this plugin
/unifi-clientsUse when operating on UniFi clients, devices, switch ports, or DHCP: "block a device", "kick a client off wifi", "restart an access point", "power cycle a PoE port", "move a device to a different VLAN", "my device is on the wrong subnet after I changed the port", "set a DHCP reservation", "change DHCP DNS servers", "forget an old client", "why did my PUT reset all the other ports", or reading UniFi events and alarms. Covers full-object PUT discipline, the wired VLAN migration trap, and where events moved. Assumes unifi-connect. Not for firewall policy between zones (unifi-firewall), radios and SSIDs (unifi-wifi)./unifi-connectUse when connecting an agent to a UniFi gateway (UDM Pro, UDM SE, Cloud Gateway) for the first time, or when API calls to one are failing: empty response bodies, curl returning HTTP 000, 401 on a key that works elsewhere, "how do I get a UniFi API key", "SSH is closed on my UDM", "connect to UniFi", "talk to my UniFi controller". Covers minting an API key over the API, which endpoint families accept a key, the cookie-session fallback, the HTTP/2 empty-body trap, the endpoint map, and the safety doctrine: dry-run, read-only mode, snapshot-before-mutate rollback, and the audit trail. Start here: the other skills assume this one. Not for firewall policy (unifi-firewall), Wi-Fi and radios (unifi-wifi), client and port operations (unifi-clients).npx claudepluginhub t3chnaztea/unifi-skills --plugin unifiOther plugins' skills for the same job