Unifi Firewall Rules Examples
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:
- 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
| 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.
| 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:
Creating and Using a Firewall Rule Group
In this example, let's create a firewall rule group for allowing remote access to administrative interfaces:
- Navigate to Firewall > Rule Groups and click Create New Group.
- Name the group (e.g., 'Admin Access'), and description (optional).
- Under Rules, click Add Rule:
- Repeat the above step to add additional rules (e.g., SSH, HTTP).
- After adding all rules, click Save.
- To apply the rule group, go to Firewall > Rules, and click Add Rule:
| Source | Destination | Service | Action |
|---|---|---|---|
| Any | 192.168.1.1/32 | HTTPS | Allow |
| 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!