If you are running a smart home, you have probably got a dozen devices, lightbulbs, cameras, smart plugs, that probably shouldn’t be chatting with your main PC or your NAS. In a standard home network, everything is “flat.” If one cheap, insecure IoT device gets compromised, it has a direct line to your private files and banking data.
The fix? Network Segmentation. By using VLANs and firewall zones in OpenWrt, you can create a “walled garden” for your untrusted devices. Here is how to lock down your network without breaking your internet access.
The Two Methods of VLAN Setup in OpenWrt
When you are looking to isolate devices in OpenWrt, you generally run into two approaches. It is important to understand the difference before you start clicking buttons.
-
Physical Port Isolation (The Bridge Method): This is the “low-level” approach. You literally take a physical Ethernet port on the back of your router, detach it from the main LAN bridge, and create a completely new, separate bridge for it. It’s simple, robust, and doesn’t require managing complex 802.1Q tags.
-
802.1Q VLAN Tagging (The Virtual Method): This is the professional standard. Instead of using separate physical ports, you “tag” traffic with a VLAN ID. This allows you to have multiple isolated networks running over the same physical wire or Wi-Fi radio. This is what you need if you want to support multiple isolated SSIDs on the same access point.
For this guide, which i have just set it and tested it myself, we will focus on the Physical Bridge method as our foundation, it’s the cleanest way to learn how OpenWrt handles routing and firewalling.
High-Level Roadmap
We aren’t just setting a checkbox; we are building a security system. We’ll follow this logical order to ensure the network never leaks traffic during the setup. The router used in this case is gl.inet flint 2,Â
-
Hardware Layer: Detach a physical port and create a new bridge device.
-
Network Layer: Define a new Interface and DHCP server for that bridge.
-
Security Layer: Create a dedicated Firewall Zone to gatekeep the traffic.
-
Wireless Layer: Create your IoT SSID and bind it to the secure bridge.
-
Finalize: Commit changes and perform an audit test (Part 2).
Step-by-Step Implementation
Step 1: Physical Hardware Separation
-
Navigate to Network > Devices.
-
Find
br-lanand click Edit. -
Under Bridge ports, uncheck the physical port you want to isolate (e.g.,
eth3). Click Save. -
Click Add device configuration. Set the Type to
Bridgeand Name itbr-iot. -
Under Bridge ports, select the port you just freed (
eth3). Click Save.
Step 2: Interface and DHCP Setup
-
Go to Network > Interfaces and click Add new interface.
-
Name it
IOT, set the protocol to Static address, and choosebr-iotas the device. -
In General Setup, assign a unique subnet (e.g.,
192.168.10.1with a netmask of255.255.255.0). -
Switch to the Firewall Settings tab. Type
iotzonein the box and click Add (or press Enter) to bind it to a new zone. -
Click the DHCP Server tab and click Setup DHCP Server. Save your changes.
Step 3: Firewall Policy (The Gatekeeper)
-
Go to Network > Firewall.
-
Find
iotzoneand click Edit. -
Set Input to
REJECT, Output toACCEPT, and Forward toREJECT. Check the box for Masquerading. -
Under Inter-Zone Forwarding, select ONLY
wanfor “Allow forward to destination zones.” Keep “Allow forward from source zones” BLANK. -
Click Save.
Step 4: Finalize and Apply
-
Review your pending changes. When you are ready, click Save & Apply at the top. Your network will briefly restart.
Step 5: Configure the IoT SSID
-
Go to Network > Wireless.
-
Click Add on your 2.4GHz or 5GHz radio.
-
Enter your ESSID (e.g.,
My-IoT-Network). -
Under the Network tab, uncheck
lanand checkIOT. This is the crucial step that links your wireless traffic to the secure bridge we created in Step 1. -
Set your encryption/password, save, and apply.
Conclusion
You’ve now built a professional grade, isolated network. By separating your IoT hardware at the bridge level and enforcing strict “Reject” policies in the firewall, you’ve significantly reduced your home network’s “blast radius.”
Pro Tip: Once you’re done, verify your isolation by connecting a laptop to the new IOT Wi-Fi and trying to ping your main router gateway (192.168.1.1). It should fail. If it does, your walled garden is officially open for business. Check out Part 2 the security audit for how some additional audits and pro tips.