unifi firewall rules examples

Unifi Firewall Rules Examples

By Ashley Allen
AD
Unifi Firewall Rules Examples: Mastering Network Security

In today's digital age, securing your network is not just an option, it's a necessity. This is where the Unifi Security Gateway (USG) firewall comes in, providing robust security features to protect your network. A significant aspect of managing your USG is understanding and defining firewall rules. In this article, we'll delve into the world of Unifi firewall rules, providing real-world examples to help you tighten your network security.

Before we dive into the specifics, let's quickly understand what firewall rules are. Firewall rules are a set of instructions that define what traffic is allowed to pass through your network and what should be blocked. With USG, you have the power to create highly customized and fine-grained rules. Now, let's explore some key aspects and examples.

Understanding Unifi Firewall Rule Basics

Firewall rules in USG are defined in a hierarchical manner, with each rule having a priority. Lower the number, higher the priority. This sequence matters as the first rule that matches the traffic is the one that applies. Let's break down the components of a basic firewall rule:

AD
Home Network Firewall Rules: Minimal Allow/Block List That Still Works
Home Network Firewall Rules: Minimal Allow/Block List That Still Works
the diagram shows how firewall works and what it is like to work with an internet network
the diagram shows how firewall works and what it is like to work with an internet network
the firewall diagram is shown in red and blue, with instructions on how to use it
the firewall diagram is shown in red and blue, with instructions on how to use it
  • Name: A friendly name for your rule. (e.g., 'Allow SSH Access')
  • Enabled: checkbox to enable or disable the rule.
  • Priority: The order in which rules are processed. Lower numbers have higher priority.
  • Source / Destination: IP addresses or address ranges that the rule applies to.
  • Service: The type of network traffic the rule applies to. (e.g., 'SSH', 'HTTP', 'Ping')
  • Action: What to do with traffic that matches the rule. ('Allow', 'Deny', 'Reject', 'Drop', etc.)

Defining Specific IP Access

One of the most common use cases is allowing or denying access to specific IP addresses. Here are two examples:

$Rule 1 - Allow Specific IP

Firewall use cases
Firewall use cases
Firewalls
Firewalls
Understanding Firewalls: Network Security Basics | Rahil Irshad posted on the topic | LinkedIn
Understanding Firewalls: Network Security Basics | Rahil Irshad posted on the topic | LinkedIn
Name Priority Source Destination Service Action
Allow IP 192.168.1.5 10 192.168.1.5 Any ANY Allow

$Rule 2 - Deny Specific IP

Name Priority Source Destination Service Action
Block IP 10.0.0.1 20 10.0.0.1 Any ANY Deny

Restricting Outbound Traffic

Another crucial aspect is controlling outbound traffic. This example blocks all outbound traffic except for DNS andulamlarh through a predefined service group.

AD
Name Priority Source Destination Service Action
Block All Outbound 15 Any Any ALL Deny
Allow DNS 25 Any Any DNS Allow
Allow Service Group 30 Any Any Service Group "AllowedServices" Allow

Using Unifi Firewall Rule Groups for Simplified Management

As your network grows, managing firewall rules can become intricate. This is where firewall rule groups come into play, allowing you to bundle related rules together. Here's how you can use them:

how to configure a firewall on windows? infographical poster
how to configure a firewall on windows? infographical poster
Firewall Explained 🔥🛡️ | How It Protects Your Computer & Network
Firewall Explained 🔥🛡️ | How It Protects Your Computer & Network
how firewall works info sheet
how firewall works info sheet
6.1K views · 44 reactions | 🔥 One Firewall Is NOT Enough in 2026🚨 Packet-Filtering, Stateful, NGFW, Proxy, Cloud, Hardware… Do you know which firewall actually protects you? Most cyber attacks succeed because companies rely on the wrong type of firewall. Each firewall has a specific role—from basic packet filtering to deep inspection, cloud protection, and enterprise perimeter security. 💡 Real cybersecurity = choosing the right firewall for the right job. 👍 Like to support cybersecurity awareness 🔁 Share with IT & non-IT friends ➕ Follow Cyber Security For Computer & AI Hub for daily security knowledge #CyberSecurity #Firewall #NetworkSecurity #ukreels #uk #CloudSecurity #usa #viralreelsfacebook #viralreelschallenge #CyberDefense | Cyber Security For Computer & AI Hub | Facebook
6.1K views · 44 reactions | 🔥 One Firewall Is NOT Enough in 2026🚨 Packet-Filtering, Stateful, NGFW, Proxy, Cloud, Hardware… Do you know which firewall actually protects you? Most cyber attacks succeed because companies rely on the wrong type of firewall. Each firewall has a specific role—from basic packet filtering to deep inspection, cloud protection, and enterprise perimeter security. 💡 Real cybersecurity = choosing the right firewall for the right job. 👍 Like to support cybersecurity awareness 🔁 Share with IT & non-IT friends ➕ Follow Cyber Security For Computer & AI Hub for daily security knowledge #CyberSecurity #Firewall #NetworkSecurity #ukreels #uk #CloudSecurity #usa #viralreelsfacebook #viralreelschallenge #CyberDefense | Cyber Security For Computer & AI Hub | Facebook
an info sheet describing the different types of firewalls and how to use them
an info sheet describing the different types of firewalls and how to use them
the firewall diagram is shown with different types of devices and their functions in it
the firewall diagram is shown with different types of devices and their functions in it

Creating and Using a Firewall Rule Group

In this example, let's create a firewall rule group for allowing remote access to administrative interfaces:

  1. Navigate to Firewall > Rule Groups and click Create New Group.
  2. Name the group (e.g., 'Admin Access'), and description (optional).
  3. Under Rules, click Add Rule:
  4. Source Destination Service Action
    Any 192.168.1.1/32 HTTPS Allow
  5. Repeat the above step to add additional rules (e.g., SSH, HTTP).
  6. After adding all rules, click Save.
  7. To apply the rule group, go to Firewall > Rules, and click Add Rule:
  8. Name Priority Rule Group Action
    Admin Access 60 Admin Access Allow

    Final paragraph: Mastering Unifi firewall rules brings immense power in controlling and securing your network. With regular updates and careful planning, you can weave an ironclad shield around your digital haven. Happy rule crafting!

🔥 Firewall Security — Quick Reminder 🛡️ → Keep rules minimal and explicit; enforce least-privilege and remove stale entries. ✅ → Forward logs to a central SIEM for visibility and alerting. ✅ → Harden admin access (IP allow-list, MFA, VPN) and require written authorization for any tests. ✅ #CyberSecurity #Firewall #InfoSec #NetworkSecurity #SIEM #RiskManagement Networking Basics, Computer Science Major, Hacking Books, Firewall Security, Learn Computer Coding, Computer Coding, Life Hacks Computer, Computer Knowledge, Best Self Help Books
🔥 Firewall Security — Quick Reminder 🛡️ → Keep rules minimal and explicit; enforce least-privilege and remove stale entries. ✅ → Forward logs to a central SIEM for visibility and alerting. ✅ → Harden admin access (IP allow-list, MFA, VPN) and require written authorization for any tests. ✅ #CyberSecurity #Firewall #InfoSec #NetworkSecurity #SIEM #RiskManagement Networking Basics, Computer Science Major, Hacking Books, Firewall Security, Learn Computer Coding, Computer Coding, Life Hacks Computer, Computer Knowledge, Best Self Help Books
the different types of firewalls are shown in this info sheet, which includes information about
the different types of firewalls are shown in this info sheet, which includes information about
the different types of firewalls and what they are used to use them for
the different types of firewalls and what they are used to use them for
the different types of firewalls are shown in this info sheet, with instructions on how to use them
the different types of firewalls are shown in this info sheet, with instructions on how to use them
Secure Your Smart Home: Unifi IoT VLAN Firewall Rules for Apple HomeKit Users! 🔒
Secure Your Smart Home: Unifi IoT VLAN Firewall Rules for Apple HomeKit Users! 🔒
firewall vs nfw info sheet
firewall vs nfw info sheet
a person sitting in front of a laptop computer with the words firewall security commands
a person sitting in front of a laptop computer with the words firewall security commands
the different types of firewalls and how to use them in this info sheet
the different types of firewalls and how to use them in this info sheet
What is a Firewall? Definition, Types & Basic Errors - Techopedia
What is a Firewall? Definition, Types & Basic Errors - Techopedia
what is a firewall? info poster on the back of a black background with text
what is a firewall? info poster on the back of a black background with text
AD