Migration support included in the MSP plan.

How to configure firewall rules for UniFi Controller

Published onFebruary 9, 2024

For MSPs and network administrators alike, making sure you run secure and efficient communication between UniFi devices and the UniFi Controller is important.

Configuring firewall rules plays a role in this process. It allows devices to communicate safely and preventing unauthorized access.

This guide will lay out an approach to configuring UniFi firewall rules.

Let's dive in!

Table of Contents

Importance of UniFi firewall rules

Firewall rules help manage and control the flow of traffic between your network and the UniFi Controller, safeguarding data and devices from potential threats.

Properly configured rules ensure that only authorized devices can communicate with the Controller, enhancing the overall security of your network.

UniFi Firewall ports

Before diving into the configuration, it's essential to understand which ports need to be open for UniFi devices and the Controller to communicate effectively:

  • TCP 8080: Used for device communication with the Controller.
  • TCP 8443: Accesses the UniFi Controller's web UI.
  • TCP 8880: Utilized for HTTP portal redirection.
  • TCP 8843: Utilized for HTTPS portal redirection.
  • UDP 3478: Necessary for STUN (Session Traversal Utilities for NAT).

Note: This is not an exhaustive list, and depending on your specific setup (e.g., guest portals, cloud access), additional ports might need to be configured.

Step-by-Step configuration

  1. Access Your Firewall Settings: This process will vary depending on your firewall solution. Access the management interface for your firewall to begin configuring the rules.

  2. Create New Firewall Rules: Start by creating new inbound and outbound rules that allow traffic on the essential UniFi controller ports. Ensure to specify that these rules apply to traffic destined for the UniFi Controller's IP address.

  3. Specify Allowed Programs: If your firewall supports application-level rules, ensure that the UniFi Controller software is allowed to communicate through the firewall. This might involve specifying the executable file in the rule.

  4. Apply the Rules: Once the rules are configured, apply them to your firewall. This might require saving the configuration and possibly rebooting the firewall for the changes to take effect.

  5. Test the Configuration: After applying the rules, test the connectivity between your UniFi devices and the Controller. Ensure that devices can be adopted and managed without issues.

UniFi Firewall best practices

  • Regularly Update UniFi Firewall Rules: As your network grows or changes, regularly review and update your firewall rules to ensure they still meet your security and connectivity needs.

  • Use Secure Management Practices: Always manage firewall and UniFi Controller settings from a secure, authenticated session to prevent unauthorized access.

  • Monitor Network Traffic: Regularly monitor network traffic for unusual patterns that could indicate a security issue, adjusting firewall rules as necessary.

  • Backup Configurations: Regularly backup your firewall and UniFi Controller configurations to quickly restore your system in case of a malfunction or breach.

Final Thoughts

Properly configuring firewall rules for your UniFi Controller important for maintaining a secure and efficient network.

The steps above make sure you have robust security in place. The security of your network is only as strong as its weakest link, making the careful configuration of firewall rules an important task in network management.

At UniHosted, we understand the complexities of advanced network configuration. Our cloud-hosted UniFi Controller services are designed to simplify the management of these features, providing a robust platform for your scalable networking needs.

Feel free to give us a spin! Additionally, I'm happy to walk you through personally. You can schedule a call with me (Founder of UniHosted) here.

We host UniFi Controllers in the Cloud

Are you ready to take your UniFi Network to the next level? Deploy a UniFi Cloud Controller in minutes and manage your network from anywhere.

Deploy Now

Free tier available

Get the best support

Join 1276+ customers

No credit card required