At least under OpenWrt (QSDK behavior unknown), the switch has two virtual interfaces. All packets to/from the LAN ports go to one, tagged VLAN 1 (as I recall) if untagged. Similarly, all packets to/from the WAN port go to the other, similarly tagged VLAN 2 if untagged. This is at the driver/DTS level and can’t be modified without code changes.
switch_cpu_bmp = <0x1>;
switch_lan_bmp = <0x1e>;
switch_wan_bmp = <0x20>;
gmac0: gmac0 {
local-mac-address = [00 00 00 00 00 00];
vlan_tag = <1 0x1f>;
};
gmac1: gmac1 {
local-mac-address = [00 00 00 00 00 00];
[...]
vlan_tag = <2 0x20>;
};
Based on this, my “rules” are
- Never configure the switch with LuCI
- Avoid VLAN 1 and VLAN 2 in any custom configs
I personally use the WAN port on my IPQ4019-based devices as the VLAN trunk and the LAN ports as untagged access ports, explicitly specifying a different VLAN from 1 & 2.
If I try to bridge the two interfaces with a Linux bridge and, for example have VLAN 100 as tagged on the WAN port and untagged on the LAN port, connectivity fails in many cases. I haven’t chased it down any further, but I think it’s related to one interface responding to ARP requests, but the other interface (with a different MAC) being the one physically connected to the requesting device.
Here’s config I’m using on a different, IPQ4019-based device. On that device the WAN port is switch port 5 and the CPU is on switch port 0.
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '10'
option vid '100'
option ports '0t 5t'
config switch_vlan
option device 'switch0'
option vlan '11'
option vid '101'
option ports '0t 1 2 3 4 5t'
config switch_vlan
option device 'switch0'
option vlan '12'
option vid '102'
option ports '0t 5t'
The DSA discussed in the below-linked thread does not yet support VLANs for the IPQ40xx devices, and is still a dead end.
I haven’t dug into this in a while, being busy shepherding the ath79 SPI-NAND support and GL-AR300M and GL-AR750S with NAND support through to OpenWrt master (finally). As my three, IPQ4019-based devices work “well enough” for me, even without having resolved the bridging of a VLAN from the trunk to the LAN ports, it hasn’t been a top priority. (Not to mention I have now have both a GL-MV1000 “Brume” and a GL-MT300N-V2 on my desk).
References