Skip to content
Contents
GuidesOpenWrt

Plan four VLANs on OpenWrt and map each managed switch port

List the management, office, IoT, and guest segments with VLAN, ID, example subnet ranges, and required services.

List the management, office, IoT, and guest segments with VLAN, ID, example subnet ranges, and required services. On DSA devices, distinguish between bridge port VLAN configuration and layer-3 interface configuration. For legacy devices still using swconfig, configure according to their own switch topology.

Start with a management port

Keep the management port accessible via physical connection. Configure trunk between switch and router with identical ID tagging at both ends. Set user terminal access ports to untagged/PVID, for example assigning VLAN and 30 to IoT devices. On the router, create a three-layer interface per bridge VLAN, assign an IP address matching DHCP, then configure fw4 zones and permitted directions.

Verify four VLANs by port on the switch

Fill in the tag and untagged VLAN settings for each port, retaining one existing management port. Plug in terminals one by one to different ports, and verify the actual VLAN assignment through DHCP address and default gateway.

Check the entry point for lease agreements, gateway, and DNS. Verify that IoT can access specified services and can only access other subnets according to rules; separately test visitor management and NAS behavior. Use bridge vlan show or trunk packet capture to verify VLAN tagging; if issues occur, restore from the reserved management port.

Management, office, IoT, and guest networks should be isolated into separate VLANs; cross-zone traffic should be permitted or denied based on policy. When encountering port lease misconfiguration, prioritize verification of PVID and uplink tag settings.

Lab record

OpenWrt VM veth test. With the same client addresses, VLAN 10 on both sides gave 2 replies. Changing the peer tag to 20 gave 0. Restoring tag 10 brought back 2 replies.

OpenWrt VM veth test. With the same client addresses, VLAN 10 on both sides gave 2 replies. Changing the peer tag to 20 gave 0. Restoring tag 10 brought back 2 replies.

Reference

Keep management access before setting a PVID

An access port needs one PVID for untagged ingress. If an AP uses untagged management and tagged SSIDs, match both ends. Add a local management or routed interface only where the switch must participate. Verify that management clients can sign in and guests cannot.

LuCI · br-sw · VID 10 / 20 · eth1 T · eth2 / eth3 U*
OpenWrt 25.12.6 · x86/64 QEMU · LuCI · br-sw · VID 10 / 20 · eth1 T · eth2 / eth3 U*

How to carry home Ethernet and ISP IPTV to the living room on one cable · One cable to the living-room router: carry WAN out and LAN back

Reference screenshot · DSA switch configuration from userspace
Reference screenshot · DSA switch configuration from userspace
Reference screenshot · DSA switch configuration from userspace Open the original image

Linux kernel documentation · GPL-2.0

Related guides

Reference

Check the model, region and hardware revision on the label before selecting firmware.

Explore hardware

Comments