What you can do
Traditional firewall rules
Create, update, and delete WAN/LAN firewall rules with full traffic matching.
Zone-Based Firewall
Group networks into security zones and manage zone membership (Local API only).
ACL management
Define Layer 3/4 access control lists with rule ordering and priority.
Traffic matching lists
Build reusable IP, MAC, domain, and port lists for firewall rules.
Traditional firewall rules
Traditional firewall rules apply to traffic on specific rulesets:WAN_IN, WAN_OUT, LAN_IN, LAN_OUT, and others. You can create rules to accept, drop, or reject traffic based on source/destination IP, protocol, and port.
Example prompts:
- “Block all inbound traffic on port 22 from the internet”
- “Show all firewall rules on the main site”
- “Create a rule to drop traffic from 10.0.0.0/8 to the IoT VLAN”
List firewall rules
Create a firewall rule
1
Preview with dry run
2
Create the rule
Firewall rule parameters
Update and delete rules
Zone-Based Firewall (ZBF)
Zone-Based Firewall is a modern approach to network security that groups networks into logical security zones (such as LAN, Guest, IoT, DMZ) and controls traffic based on zone membership rather than individual IP rules. ZBF is available on UniFi Network Application 9.0 and later.Zone-Based Firewall endpoints are only available when using the Local Gateway API (
UNIFI_API_TYPE=local). These tools return an error if you are using a Cloud API mode. Zone-to-zone traffic policies must be configured in the UniFi Console UI—the API supports zone and network membership management only.- “Create an IoT security zone and assign VLAN 20 to it”
- “Show all configured firewall zones”
- “Add the guest network to the Guest zone”
List zones
Create a zone
Assign a network to a zone
Remove a network from a zone
List networks in a zone
Update or delete a zone
ACL management
Layer 3/4 access control lists give you fine-grained control over traffic between network segments. ACLs support rule ordering and priority, making them suitable for complex inter-VLAN policies. Example prompts:- “Block the IoT VLAN from accessing the corporate LAN”
- “Allow the management VLAN to reach all other VLANs”
list, create, update, and delete, all requiring confirm=True for mutating operations.
Traffic matching lists
Traffic matching lists let you define reusable collections of IP addresses, MAC addresses, domain names, or port numbers. You can reference these lists in firewall rules instead of hard-coding individual values. Supported list types:
Example prompts:
- “Create an IP list called ‘trusted-admins’ with these addresses: 192.168.1.10, 192.168.1.11”
- “Block all traffic to domains in the ‘social-media’ list”
Example: blocking IoT devices from reaching the corporate LAN
This walkthrough shows how to isolate IoT devices from the rest of your network.1
Identify the networks
2
Preview the rule
3
Apply the rule