
Ready to travel
Ready to fly to London with my Journeyman. Hoping it fits EasyJet cabin under seat.

Ready to fly to London with my Journeyman. Hoping it fits EasyJet cabin under seat.
# Bug Summary
**Short Description:**
After boot on firmware 4.8.6, switch port 1's PVID is set to the highest tagged VLAN ID
(40) instead of the UCI-declared untagged VLAN (1), breaking VLAN trunking on the affected
port.
---
# Device Information
* **Device Model:** GL-MT5000 (Brume 3)
* **Hardware Revision:** GL.iNet GL-MT5000
* **Firmware Version:** 4.8.6
* **Firmware Type:** Stable
* **Upgrade Method:** OTA via Web UI
* **Previous Firmware Version:** 4.8.5
---
# Environment Information
* **ISP:** MEO (Portugal)
* **Connection Type:** DHCP (clean Ethernet, no PPPoE)
* **Topology Overview:**
ISP ONT → Brume 3 LAN1 (recovery, untagged VLAN 1) → Mac
Brume 3 LAN2 (trunk: VLANs 1, 20, 30, 40 tagged) → Asus AP → Wi-Fi clients
* **Connected Devices:** ~12 (Macs, iPhones, Apple TV, iPad, Linux server, IoT bulbs)
---
# Issue Description
When a switch port is declared as a member of multiple `switch_vlan` sections (one untagged + multiple
tagged), the RTL8366UB driver sets that port's PVID to the **highest tagged VLAN ID** instead of the
UCI-declared untagged VLAN.
In my configuration:
- Port 1 is declared untagged on VLAN 1 (`vlan_lan.ports='0 1 17t'`)
- Port 1 is also tagged member of VLANs 20, 30, 40
- After boot, `swconfig dev switch0 port 1 get pvid` returns `40` instead of `1`
Result: untagged ingress on the trunk lands on Guest VLAN (40) instead of the management VLAN. The
downstream AP loses its management VLAN backhaul, all SSIDs lose access to their proper VLANs, DHCP
requests get NAK'd, Wi-Fi clients lose connectivity.
---
# Steps to Reproduce
config switch_vlan
option device 'switch0'
option vlan '20'
option ports '1t 17t'
config switch_vlan
option device 'switch0'
option vlan '30'
option ports '1t 17t'
config switch_vlan
option device 'switch0'
option vlan '40'
option ports '1t 17t'
4. Reboot.
5. Run `swconfig dev switch0 port 1 get pvid`.
---
# Expected Result
`swconfig dev switch0 port 1 get pvid` returns `1` (the VLAN where port 1 is declared untagged).
---
# Actual Result
`swconfig dev switch0 port 1 get pvid` returns `40` (the highest tagged VLAN ID).
---
# Frequency
**Always.** Reproduces on every boot. Also reproduces on every `swconfig set apply` triggered by
interface ifup/ifdown, fw3 reload, or GL.iNet UI route_policy apply.
---
# Logs and Diagnostics
### Device info
$ cat /tmp/sysinfo/model
GL.iNet GL-MT5000
$ cat /etc/glversion
4.8.6
$ uname -a
Linux GL-MT5000 5.4.281 #0 SMP Wed Apr 22 02:33:08 2026 aarch64 GNU/Linux
$ uptime
17:56:01 up 3 min, load average: 0.08, 0.24, 0.12
### Switch state immediately after this boot
$ swconfig dev switch0 port 0 get pvid
1
$ swconfig dev switch0 port 1 get pvid
40
$ swconfig dev switch0 show | grep -E "Port|pvid|VLAN"
Port 0: pvid: 1
Port 1: pvid: 40
Port 16: pvid: 1
Port 17: pvid: 1
VLAN 1: Ports: '0 1 17t', members=20003, untag=0003, fid=0
VLAN 2: Ports: '1 17t', members=20002, untag=0002, fid=0
### UCI declaration (the contract being violated)
network.vlan_lan.device='switch0'
network.vlan_lan.vlan='1'
network.vlan_lan.ports='0 1 17t'
network.@switch_vlan[1].vlan='20'
network.@switch_vlan[1].ports='1t 17t'
network.@switch_vlan[2].vlan='30'
network.@switch_vlan[2].ports='1t 17t'
network.@switch_vlan[3].vlan='40'
network.@switch_vlan[3].ports='1t 17t'
### dmesg showing driver init sequence and final port-1 link state
[ 8.470243] rtl8366ub gsw@0: RTL8366UB Driver Version=1.0.0
[ 10.530857] rtl8366ub gsw@0: found an RTL8366UB switch
[ 10.817804] [rtl8366ub_swconfig_init]
[ 13.503168] [rtl8366ub_sw_set_vlan_ports] vid=1 , mem=20003, untag=3
[ 13.510345] [rtl8366ub_sw_set_vlan_ports] vid=20, mem=20002, untag=0
[ 13.517506] [rtl8366ub_sw_set_vlan_ports] vid=30, mem=20002, untag=0
[ 13.524649] [rtl8366ub_sw_set_vlan_ports] vid=40, mem=20002, untag=0
[ 14.620919] rtl8366ub gsw@0: Port 1 Link is Up - 2.5Gbps/Full
After this sequence completes, port 1 PVID is 40 (not 1).
### Boot timeline (logread, from `Interface 'lan' is enabled` to L2 up)
17:51:59 netifd: Interface 'lan' is enabled
17:51:59 netifd: Interface 'guest' is enabled
17:51:59 netifd: Interface 'iot' is enabled
17:51:59 netifd: Interface 'servers' is enabled
17:51:59 netifd: Interface 'wan' is enabled
17:51:59 netifd: Network device 'eth0' link is up
17:51:59 netifd: VLAN 'eth0.1' link is up
17:51:59 kernel: rtl8366ub gsw@0: Port 1 Link is Up - 2.5Gbps/Full
17:51:59 netifd: VLAN 'eth0.20' link is up
17:51:59 netifd: VLAN 'eth0.30' link is up
17:51:59 netifd: VLAN 'eth0.40' link is up
17:51:59 netifd: bridge 'br-lan' link is up