UniFi Zone-Based Firewall: Setup Guide & Best Practices
Updated for UniFi Network 11. Starting with UniFi Network 9.0, Ubiquiti introduced a zone-based firewall that replaces the old per-rule model with something closer to what enterprise firewalls (Palo Alto, Fortinet) have used for years. Instead of writing individual allow/deny rules between networks, you group networks into zones and define policies between zones.
If you've ever hand-crafted dozens of LAN In rules to isolate an IoT VLAN from your trusted network, you already know why this matters. Zones scale better, are easier to audit, and dramatically reduce the chance of a misconfigured rule.
This guide walks you through setting up a clean zone-based firewall from scratch, including how to migrate if you're coming from the legacy rules system.
Rather have a pro handle it? KJJ Tech sets up and audits UniFi zone-based firewalls every week, onsite in Orlando or remotely at a flat price anywhere in the U.S. Book a free 30-minute call →
What Is a Zone?
A zone is a logical grouping of one or more networks (VLANs) that share the same trust level. Instead of writing rules between every VLAN pair, you put each VLAN in a zone, then write a single policy between zones.
UniFi ships with these default zones:
- Internal: your main trusted networks
- Gateway: the UniFi gateway itself
- External: WAN / internet
- DMZ: for externally-reachable servers
- VPN: VPN client networks
- Hotspot: guest captive portal networks
You can also create custom zones, and this is where the real power lives.
Prerequisites
- A UniFi gateway running Network 9.0 or newer (UDM, UDM Pro, UDM SE, UXG, UCG, Cloud Gateway, etc.). Menu names in this guide are from Network 11; older 9.x versions use slightly different labels.
- At least two VLANs already configured (if you haven't set those up yet, start with our VLAN setup guide)
- A device you can test with on each VLAN
Step 1: Find the Zone-Based Firewall
Go to Settings → Policy Engine. Zones shows the zone matrix, and the Policy Table lists every firewall policy in one place. On Network 11 the zone-based firewall is the only firewall: sites still on the legacy LAN In / LAN Out rules were migrated to zones automatically during the upgrade.
Also check the Default Security Posture (on the Settings → Networks page, below the network list). Allow All is the default and lets your internal networks reach each other; Block All blocks everything between networks until you allow it. Most homes and small offices are best served by leaving it on Allow All and using custom zones, below, to contain untrusted devices.
Important: The automatic migration from legacy rules isn't always perfect. If your site was upgraded from older firmware, open the zone matrix and the Policy Table and confirm your inter-VLAN blocks still behave the way you intended.
Step 2: Plan Your Zones
Before you click anything, sketch out what zones you actually need. For a typical small business or home network, something like this works well:
- Trusted: your main LAN, work devices, servers
- IoT: smart home gear, cameras, smart TVs
- Guest: the network your guests' phones land on
- Management: your UniFi controller, switches, APs (optional but recommended)
The golden rule: group networks by how much you trust them, not by what they do. Two networks that should have identical firewall treatment belong in the same zone.
Step 3: Create Your Custom Zones
In Settings → Policy Engine → Zones, click Create Zone:
- Give the zone a clear name (e.g.,
IoT,Guest,Trusted) - Assign the VLANs that belong in this zone
- Save
Each network can only belong to one zone at a time. UniFi enforces this: you can't accidentally double-assign.
Step 4: Define Policies Between Zones
This is where the zone model shines. The Zones view is a matrix: rows are source zones, columns are destination zones, and each cell is the traffic flow between them. Traffic between the built-in Internal zone and a new custom zone is blocked by default, so you only add allow policies for what should cross. Return traffic for an allowed connection is permitted automatically.
For a typical home/SMB setup, you want something like:
| From → To | Trusted | IoT | Guest | External |
|---|---|---|---|---|
| Trusted | Allow | Allow | Block | Allow |
| IoT | Block | Allow | Block | Allow |
| Guest | Block | Block | Allow | Allow |
Trusted can reach IoT (so you can control your smart lights), but IoT can't reach Trusted (so a compromised smart plug can't pivot to your laptop). Guest can reach the internet and other Guests, and nothing else.
Click any cell and choose Create Policy to add one; every policy then appears in the Policy Table, where you can edit and reorder them. You can add exceptions within a block, for example, Block IoT → Trusted, except allow IoT to reach 192.168.1.50 on port 80 (for a shared printer).
Step 5: Test Each Zone
Connect a device to each VLAN and verify:
- Trusted devices can still reach IoT devices (your phone controls the lights)
- IoT devices cannot ping Trusted devices
- Guest devices can reach the internet but nothing internal
- Everything can still reach the internet (External)
If a device can't get online, check whether its zone has an Allow policy to External. That's the #1 mistake during migration.
Migrating From Legacy Firewall Rules
On Network 11 the migration happens automatically when you upgrade. If you had a lot of legacy rules, here's how to make sure nothing broke:
- Screenshot everything before upgrading. Every legacy rule, every group. You'll thank yourself later.
- Upgrade in a maintenance window. Don't do this on a Friday afternoon when the office is trying to leave.
- Review the converted policies in the Policy Table. Open each one and verify it matches your intent.
- Consolidate redundant rules. A lot of legacy rules become unnecessary under zones. You were often writing the same rule 3 times for 3 different VLANs that could've been in one zone.
- Keep the exception rules. Anywhere you had a specific "allow X device to reach Y" rule, that needs to live on as a specific allow inside the zone policy.
Common Mistakes to Avoid
- Too many zones. If you have 12 zones for 14 VLANs, you're back to per-rule territory. Aim for 3-5 zones max in most environments.
- Forgetting the Gateway zone. DNS and DHCP run on the gateway. If you block everything to the Gateway zone, devices can't resolve names. Always allow traffic to Gateway for services like DNS, DHCP, and NTP.
- Blocking mDNS and then being confused why AirPlay doesn't work. If you want cross-VLAN AirPlay or Chromecast, enable Multicast DNS between the relevant zones.
- Not locking down Management. If you put your controller and switches in a Management zone, only allow Trusted → Management. Don't leave it reachable from IoT.
When to Call a Professional
Zone-based firewalls are a huge improvement, but they're still a firewall, and a misconfiguration can leave you exposed or locked out. If you're running a business network, dealing with compliance requirements (HIPAA, PCI), or trying to migrate a complex legacy ruleset without downtime, it's worth having a second set of eyes.
Free: UniFi Security Checklist
26 settings to check on any UniFi network, from admin accounts to firewall zones, on one printable PDF.
No spam. Just the PDF, plus an occasional new guide.
Need help with your UniFi firewall?
We set up and audit zone-based firewalls for homes and businesses every week. Let's get yours dialed in properly.
Book a free call Remote firewall setup: $750 flat