While trying to get some funky switch configuration working involving creating a bridge across two (or more) vlans I encountered this bug on the latest wndr3700 image:
https://dev.openwrt.org/ticket/8701
I have manually adjusted the /lib/network/switch.sh file with the information listed in that ticket and that has solved the issue.
Maybe it is an idea to get the solution as listed in that ticket included into the wndr3700 build. Because the support of fid in vlan configurations is model/hardware depended it can not be included as a standard OpenWRT fix currently
just to be clear here is the diff between the standard version and my adjusted version
--- /rom/lib/network/switch.sh
+++ /overlay/upper/lib/network/switch.sh
@@ -1,5 +1,7 @@
#!/bin/sh
# Copyright (C) 2009 OpenWrt.org
+#
+# added extra function based on https://dev.openwrt.org/ticket/8701
setup_switch_dev() {
local name
@@ -7,9 +9,25 @@
name="${name:-$1}"
[ -d "/sys/class/net/$name" ] && ifconfig "$name" up
swconfig dev "$name" load network
+ config_foreach fid_switch_vlan switch_vlan
}
setup_switch() {
config_load network
config_foreach setup_switch_dev switch
}
+
+# newly added KD
+
+fid_switch_vlan() {
+ local fid vlan
+
+ config_get fid "$1" fid
+ config_get vlan "$1" vlan
+ config_get device "$1" device
+
+ if [[ -n "$fid" ]]; then
+ swconfig dev $device vlan $vlan set fid $fid
+ fi
+}
+
and then I manually added the following lines to the relevant /etc/config/network sections
config switch_vlan
option device 'switch0'
option fid '2'
option vlan '2'
option ports '1 5t'
so here the FID is set to 2 for this vlan. Ideally you also make it possible to set the FID via the Luci interface for the switch when changing the switch configuration but I'm not capable of doing that :-)
Without this change to the way the switch is setup it is not possible to setup a bridged interface that is bridging two or more vlans. The reason why I wanted that is so that I can very easily capture all traffic going to a specific host connected to a port using tcpdump for debugging purposes. So now I can hookup a host to port 3 (as listed on the wndr3700 it self) and than it is considered as part of the LAN (so br-lan) and then run tcpdump -i eth0.2 to capture all trafic to that device only.
You could possibly also do that with filters on MAC or IP .. but this is a generic solution and can work with any host now.
I understood that using this setup makes the network throughput a bit slower .. but that does not matter to me now.
Kees D.