The 2025 Guide to Configuring VLANs on a UniFi Network
So you've set up your Ubiquiti UniFi network. You have a powerful gateway, a switch, and a few access points providing great Wi-Fi coverage. But right now, all of your devices are on one big, flat, and insecure network. Your trusted laptop is on the same network as your smart TV that hasn't been updated in years, and your guest's phone is on the same network as your sensitive file server. This is a major security risk. The professional solution to this problem is network segmentation, and the easiest way to achieve it is with VLANs (Virtual Local Area Networks). This guide will provide a step-by-step walkthrough of how to configure VLANs on your UniFi network in 2025.
What is a VLAN and Why Do You Need It?
A VLAN allows you to create multiple, separate, virtual networks on your single physical network. Think of it like creating different, secure "lanes" on a highway. The primary reason to use VLANs is security. By placing less trusted devices, like IoT gadgets (smart speakers, TVs, cameras) or guest devices, on their own separate VLAN, you can use firewall rules to prevent them from ever being able to access your trusted computers and servers. If one of those IoT devices gets hacked, the damage is contained entirely within its own isolated network segment.
For this guide, we will create three common, essential VLANs:
- Trusted LAN (Default): For your personal computers, phones, and servers.
- IoT VLAN: For all your less-secure smart home devices.
- Guest VLAN: For visitors to your home or office.
Step 1: Create the Virtual Networks (VLANs)
First, we need to define our new networks in the UniFi Network Controller.
- Log in to your UniFi Controller and go to Settings > Networks.
- Click "Create New Network."
- Let's create the IoT network first. Configure the following:
- Name: `IoT`
- Gateway IP/Subnet: Choose a different IP range from your main network. For example, if your main LAN is `192.168.1.1/24`, use `192.168.20.1/24` for your IoT network.
- VLAN ID: Assign a unique number, like `20`.
- Click "Add Network."
- Repeat the process to create a "Guest" network. Give it a different subnet (e.g., `192.168.30.1/24`) and VLAN ID (e.g., `30`). For the Guest network, you can also enable "Guest Hotspot" features if you wish.
Step 2: Create the Wi-Fi Networks and Assign VLANs
Now we need to create separate Wi-Fi SSIDs that will place devices onto our new VLANs.
- Go to Settings > WiFi.
- Click "Create New WiFi Network."
- Let's create the IoT Wi-Fi. Configure the following:
- Name (SSID): `MyHome_IoT`
- Password: Set a strong, unique password.
- Network: This is the critical step. Select the `IoT` network you created in Step 1.
- Click "Add WiFi Network."
- Repeat the process to create a "Guest" Wi-Fi network, assigning it to the `Guest` network you created.
Your UniFi Access Points will now provision, and you will see your new Wi-Fi networks being broadcast. Any device that connects to "MyHome_IoT" will automatically be placed on the isolated IoT VLAN.
Step 3: Create the Essential Firewall Rules
Your networks are separate, but by default, UniFi allows all traffic between them. We must now create firewall rules to lock them down.
- Go to Settings > Security > Firewall Rules.
- Rule 1: Block IoT from LAN. Our goal is to prevent any device on the IoT network from being able to talk to our trusted LAN.
- Click "Create New Rule."
- Action: Drop
- Source: Select "Network" and choose the `IoT` network.
- Destination: Select "Network" and choose your default `LAN` network.
- Save the rule. This is a "LAN In" rule.
- Rule 2: Block Guest from LAN. Repeat the exact same process as above, but for the Guest network. Create a "Drop" rule where the source is the `Guest` network and the destination is the `LAN` network.
With these two rules in place, you have successfully segmented your network. Devices on your IoT and Guest networks can get to the internet, but they are completely blocked from accessing any of your trusted devices on your main LAN.
Conclusion: A Foundation for a Secure Network
Configuring VLANs is the single most powerful step you can take to elevate your home or small business network from a consumer-grade setup to a professional, secure environment. By using the intuitive interface of the UniFi Network Controller to create separate networks for your different device types and then applying simple firewall rules, you have built a resilient and hardened network that is prepared for the security challenges of 2025.