VLAN tagging / bridge default configuration on WZR-HP-AG300H
|Reported by:||trick@…||Owned by:||developers|
|Priority:||normal||Milestone:||Barrier Breaker 14.07|
I have a few of these routers and found that whenever I tried to set the CPU port (0) to tagged so I could create multiple VLANs, I lost access to VLAN 1: https://lists.openwrt.org/pipermail/openwrt-devel/2012-October/017142.html
After a lot of investigation and trying a lot of things, I found the problem is quite simple...the default bridge configuration for the lan interface uses eth0, not eth0.1:
config interface 'lan' option ifname 'eth0' option type 'bridge' option proto 'static' option ipaddr '192.168.1.1' option netmask '255.255.255.0' config switch_vlan option device 'eth0' option vlan '1' option ports '0 1 2 3 4' root@OpenWrt:~# brctl show bridge name bridge id STP enabled interfaces br-lan 8000.4ce676c4cc86 no eth0
To make it possible to use multiple VLANs, the fix is to change the lan interface to bind on eth0.1 and set port 0 to tagged:
config interface 'lan' option ifname 'eth0.1' option type 'bridge' option proto 'static' option ipaddr '192.168.1.1' option netmask '255.255.255.0' config switch_vlan option device 'eth0' option vlan '1' option ports '0t 1 2 3 4'
It seems this question has been asked and answered before: https://forum.openwrt.org/viewtopic.php?pid=155341#p155341
The default configuration for this router should be changed so that users who want to use multiple VLANs can do so without having to figure this out.
Attached is a patch which fixes this for *just* the AG300H. Looking at the list, there are about 20 other routers with this same default configuration which could possibly benefit from this fix - but I would want someone to test them first:
ap121 |\ ap121-mini |\ ap96 |\ airrouter |\ dir-600-a1 |\ dir-615-c1 |\ dir-615-e4 |\ ja76pf |\ rb-750 |\ rb-751 |\ tew-632brp |\ tew-712br |\ tl-mr3220 |\ tl-mr3420 |\ tl-wr741nd |\ tl-wr741nd-v4 |\ tl-wr841n-v7 |\ whr-g301n |\ whr-hp-g300n |\ whr-hp-gn)