<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>openwrt on Samirtech</title>
    <link>https://samirtech.org/tags/openwrt/</link>
    <description>Recent content in openwrt on Samirtech</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 29 Sep 2026 14:48:04 +0100</lastBuildDate><atom:link href="https://samirtech.org/tags/openwrt/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Carrying an Isolated Wi-Fi VLAN Across OpenWrt and Managed Switches</title>
      <link>https://samirtech.org/posts/carrying-an-isolated-wifi-vlan-across-openwrt-and-managed-switches/</link>
      <pubDate>Tue, 29 Sep 2026 14:48:04 +0100</pubDate>
      
      <guid>https://samirtech.org/posts/carrying-an-isolated-wifi-vlan-across-openwrt-and-managed-switches/</guid>
      <description>I wanted ordinary wireless and IoT clients separated from the network used to manage my homelab. The router already provided the isolated network, so the job was to carry it to a UniFi access point without moving the access point or switches onto it.
The useful part was not the particular hardware. It was making several vendors agree on one simple Ethernet contract:
Management network native / untagged Isolated Wi-Fi VLAN tagged Here, native/untagged is a property of each Ethernet link, not of a VLAN everywhere.</description>
      <content>&lt;p&gt;I wanted ordinary wireless and IoT clients separated from the network used to manage my homelab. The router already provided the isolated network, so the job was to carry it to a UniFi access point without moving the access point or switches onto it.&lt;/p&gt;
&lt;p&gt;The useful part was not the particular hardware. It was making several vendors agree on one simple Ethernet contract:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Management network    native / untagged
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Isolated Wi-Fi VLAN   tagged
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here, &lt;strong&gt;native/untagged is a property of each Ethernet link&lt;/strong&gt;, not of a VLAN everywhere. On these links, management frames leave without an 802.1Q tag, while isolated-network frames leave with the example VLAN tag. The receiving port classifies incoming untagged frames into the management VLAN using its PVID.&lt;/p&gt;
&lt;p&gt;I have deliberately replaced my addresses, VLAN number, SSID, port numbers and device identifiers with examples. The method matters; publishing a map of my own network does not.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/mixed-trunk-diagram.png&#34; alt=&#34;Diagram of an access point and managed switches carrying an untagged management network and tagged example client VLAN&#34;&gt;&lt;/p&gt;
&lt;h2 id=&#34;the-design&#34;&gt;The design&lt;/h2&gt;
&lt;p&gt;The router remains responsible for DHCP, routing and firewall policy. UniFi defines the Wi-Fi network and adds the VLAN tag, while every managed switch in the path carries that tag unchanged.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Wi-Fi client
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    |
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;UniFi access point
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    |  management untagged + isolated Wi-Fi tagged
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;managed switch path
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    |
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;OpenWrt router
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    |-- management bridge
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    `-- tagged VLAN device -&amp;gt; isolated bridge
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For the examples below, I use VLAN &lt;code&gt;30&lt;/code&gt;. Substitute the VLAN ID chosen for your own network.&lt;/p&gt;
&lt;p&gt;The access point itself remains on the untagged management network. Only client traffic from the isolated SSID uses the tagged VLAN.&lt;/p&gt;
&lt;h2 id=&#34;prepare-a-rollback-path-before-changing-vlans&#34;&gt;Prepare a rollback path before changing VLANs&lt;/h2&gt;
&lt;p&gt;I export the router and switch configurations before changing membership, PVIDs or management addressing. I also record the original values and keep a laptop on a known untagged management port with a tested local administrator login. Where the hardware permits it, a serial console or other direct-management path is safer than depending on the Wi-Fi or trunk being changed.&lt;/p&gt;
&lt;p&gt;The rollback is decided before applying anything: change one device at a time, use an apply-with-rollback timer where available, and keep the old management VLAN until the new path works from a second session. If management disappears, I stop and restore the saved configuration through the direct path instead of making more remote guesses. This is slower than changing the whole path at once and much less likely to turn a VLAN mistake into a physical recovery visit.&lt;/p&gt;
&lt;h2 id=&#34;1-define-the-network-in-unifi&#34;&gt;1. Define the network in UniFi&lt;/h2&gt;
&lt;p&gt;Because OpenWrt, not UniFi, is the gateway, I created the VLAN in UniFi as a &lt;strong&gt;third-party gateway&lt;/strong&gt; network. Older UniFi versions called this a &lt;strong&gt;VLAN-only&lt;/strong&gt; network. I then assigned a temporary test SSID to it.&lt;/p&gt;
&lt;p&gt;This definition tells the access point to tag traffic from the SSID. It does not make UniFi the gateway or give it responsibility for DHCP and firewall policy.&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/unifi-ssid-vlan-redacted.png&#34; alt=&#34;Redacted UniFi excerpt showing a placeholder test SSID assigned to example VLAN 30&#34;&gt;&lt;/p&gt;
&lt;p&gt;The screenshot above is deliberately redacted and relabelled. &lt;code&gt;TEST-WIFI&lt;/code&gt; and VLAN &lt;code&gt;30&lt;/code&gt; are examples, not my live values.&lt;/p&gt;
&lt;p&gt;On the access-point uplink and every switch-to-switch link in the path, the intended policy is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Native network: management network
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Tagged networks: allow VLAN 30
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A temporary SSID makes testing safer because it does not disturb an existing wireless network. Its name does not need to describe the real network or its purpose.&lt;/p&gt;
&lt;h2 id=&#34;2-configure-every-managed-switch-link&#34;&gt;2. Configure every managed-switch link&lt;/h2&gt;
&lt;p&gt;On a third-party managed switch, I enabled advanced 802.1Q VLAN handling and configured both ends of each trunk consistently:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Management VLAN  -&amp;gt; untagged, management PVID
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;VLAN 30          -&amp;gt; tagged
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/managed-switch-trunk-example.png&#34; alt=&#34;Example managed-switch trunk contract with management untagged and the isolated Wi-Fi VLAN tagged&#34;&gt;&lt;/p&gt;
&lt;p&gt;The exact menus differ by vendor, but three values matter:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;membership&lt;/strong&gt; decides whether a VLAN is allowed on a port;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;tagged or untagged&lt;/strong&gt; decides how frames leave that port;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;PVID&lt;/strong&gt; is the VLAN classification assigned to untagged frames arriving on that port. It does not decide whether frames leave tagged or untagged; that is a separate egress setting.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a mixed trunk, the management network stays untagged and the isolated client VLAN stays tagged. An inconsistent setting on any link can let the access point remain manageable while preventing its wireless clients from obtaining an address.&lt;/p&gt;
&lt;h2 id=&#34;3-terminate-the-tag-on-the-openwrt-bridge&#34;&gt;3. Terminate the tag on the OpenWrt bridge&lt;/h2&gt;
&lt;p&gt;My first attempt created an 802.1Q device directly on a physical LAN port:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;lan-port.30 -&amp;gt; isolated bridge
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A client could authenticate to Wi-Fi but reported an IP-configuration failure. The VLAN device received no useful traffic.&lt;/p&gt;
&lt;p&gt;On this DSA-based OpenWrt setup, the physical port was already a member of the main LAN bridge. The working Layer-3 endpoint therefore sat above that bridge rather than directly on the enslaved port:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Device type: VLAN (802.1q)
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Base device: br-lan
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;VLAN ID: 30
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Device name: br-lan.30
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/openwrt-vlan-device-example.png&#34; alt=&#34;Recreated OpenWrt VLAN-device fields using placeholder VLAN 30&#34;&gt;&lt;/p&gt;
&lt;p&gt;I then added the logical VLAN device &lt;code&gt;br-lan.30&lt;/code&gt; to the existing isolated bridge:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;https://samirtech.org/images/posts/isolated-wifi-vlan/openwrt-bridge-port-example.png&#34; alt=&#34;Recreated OpenWrt bridge fields showing the example VLAN device attached to an isolated bridge&#34;&gt;&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;physical LAN port
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;       |
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;     br-lan
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;       |-- untagged management traffic
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;       `-- br-lan.30 -&amp;gt; isolated bridge
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The existing isolated interface remained the single Layer-3 gateway and DHCP-serving interface. Adding &lt;code&gt;br-lan.30&lt;/code&gt; extended that same network onto Ethernet; it did not create another subnet, gateway or DHCP server.&lt;/p&gt;
&lt;p&gt;Verify which bridge mode is active before using this pattern. With &lt;strong&gt;bridge VLAN filtering disabled&lt;/strong&gt;, &lt;code&gt;br-lan&lt;/code&gt; can carry tags transparently, but it may also forward the tagged VLAN through other member ports. With &lt;strong&gt;bridge VLAN filtering enabled&lt;/strong&gt;, add an explicit bridge-VLAN membership row and mark only the intended trunk port or ports as tagged for VLAN &lt;code&gt;30&lt;/code&gt;; OpenWrt may then generate &lt;code&gt;br-lan.30&lt;/code&gt; from that row, in which case you should not create a second device with the same name. Creating a VLAN device defines the router endpoint, but it does not replace the per-port trunk policy.&lt;/p&gt;
&lt;p&gt;This detail is platform-specific rather than a universal rule. OpenWrt devices can expose switching in different ways, and older instructions may describe &lt;code&gt;swconfig&lt;/code&gt; rather than DSA. Check how the target device represents its ports and bridges before copying an interface layout.&lt;/p&gt;
&lt;h2 id=&#34;4-verify-the-physical-path-before-redesigning-it&#34;&gt;4. Verify the physical path before redesigning it&lt;/h2&gt;
&lt;p&gt;One fault was much less technical: the cable connected to the configured switch port was not the uplink I thought it was.&lt;/p&gt;
&lt;p&gt;That is easy to miss in a mixed-vendor network. A correct VLAN configuration on the wrong physical port is still a broken configuration.&lt;/p&gt;
&lt;p&gt;Before changing bridges, DHCP or firewall rules, verify:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;which physical port leads toward the router;&lt;/li&gt;
&lt;li&gt;which port leads to the next switch;&lt;/li&gt;
&lt;li&gt;which port leads to the access point;&lt;/li&gt;
&lt;li&gt;whether link state and the switch MAC table support that map;&lt;/li&gt;
&lt;li&gt;whether labels match the cables that are actually connected.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;5-test-one-layer-at-a-time&#34;&gt;5. Test one layer at a time&lt;/h2&gt;
&lt;p&gt;A successful Wi-Fi association proves only that the radio and authentication worked. It does not prove that the tagged Ethernet path, DHCP, routing or isolation works.&lt;/p&gt;
&lt;p&gt;I tested in this order:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Association:&lt;/strong&gt; the client joins the temporary SSID.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;VLAN transport:&lt;/strong&gt; tagged traffic reaches the router-side VLAN device.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;DHCP:&lt;/strong&gt; the client receives an address from the isolated network&amp;rsquo;s DHCP server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Internet access:&lt;/strong&gt; DNS and normal outbound traffic work as intended.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Isolation:&lt;/strong&gt; access to the management network is blocked unless a narrow rule explicitly permits it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Management:&lt;/strong&gt; the access point and switches remain reachable through the untagged management network.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;An &lt;strong&gt;IP configuration failure&lt;/strong&gt; shows that Wi-Fi association succeeded but address configuration did not. A missing VLAN on a trunk is one common cause, but so are an incorrectly bound or disabled DHCP server, firewall rules blocking DHCP to the router, an exhausted address pool or a rogue DHCP server. Check whether the client&amp;rsquo;s DHCP Discover reaches the VLAN endpoint and whether an Offer returns through the same path.&lt;/p&gt;
&lt;h2 id=&#34;firewall-policy-still-matters&#34;&gt;Firewall policy still matters&lt;/h2&gt;
&lt;p&gt;A VLAN separates broadcast domains, but it is not automatically a security boundary. If the router forwards freely between networks, a separate VLAN provides organisation without meaningful isolation.&lt;/p&gt;
&lt;p&gt;The isolated zone allows only the required traffic &lt;strong&gt;to the router&lt;/strong&gt;, such as DHCP and router-hosted DNS, and permits forwarding to the WAN. It has no broad forwarding permission to the management zone. Router administration services such as LuCI and SSH are blocked from the isolated zone unless explicitly allowed. If IPv6 is enabled, test and enforce the same policy over IPv6 rather than checking IPv4 alone.&lt;/p&gt;
&lt;p&gt;This policy isolates the VLAN from management networks. It does not automatically prevent clients on the isolated SSID from communicating with one another; peer isolation is a separate access-point or firewall design choice.&lt;/p&gt;
&lt;p&gt;Test the negative case from an actual client. A working internet connection does not prove that private destinations are blocked.&lt;/p&gt;
&lt;h2 id=&#34;the-reusable-lesson&#34;&gt;The reusable lesson&lt;/h2&gt;
&lt;p&gt;Multi-vendor VLANs work when every link agrees on the same contract. Write that contract down before opening any control panel:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;What stays untagged?
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Which VLAN IDs must be tagged?
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Which device supplies DHCP and routing?
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Where is inter-VLAN access blocked?
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then test from the client toward the router, one layer at a time. In my case, the two most useful fixes were terminating the VLAN on the OpenWrt bridge rather than the enslaved physical port, and checking the real cable path before changing more configuration.&lt;/p&gt;
&lt;h3 id=&#34;official-references&#34;&gt;Official references&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://help.ui.com/hc/en-us/articles/9761080275607-Creating-Virtual-Networks-VLANs&#34;&gt;Ubiquiti: Creating Virtual Networks (VLANs)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://help.ui.com/hc/en-us/articles/26136823938583-Creating-WiFi-and-Broadcasting-VLANs&#34;&gt;Ubiquiti: Creating UniFi WiFi SSIDs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://help.ui.com/hc/en-us/articles/26136855808919-Switch-Port-VLAN-Assignment-Trunk-Access-Ports&#34;&gt;Ubiquiti: Switch Port VLAN Assignment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://help.ui.com/hc/en-us/articles/9592924981911-Virtual-Network-VLAN-Troubleshooting&#34;&gt;Ubiquiti: Virtual Network (VLAN) Troubleshooting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://openwrt.org/docs/guide-user/network/dsa/dsa-mini-tutorial&#34;&gt;OpenWrt: DSA mini tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://developers.redhat.com/articles/2022/04/06/introduction-linux-bridging-commands-and-features&#34;&gt;Red Hat Developers: Introduction to Linux bridging commands and features&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    </item>
    
  </channel>
</rss>
