[Solved] Internet redudancy with two routers and two connections

I am not sure If a trunk port is what I need in order to use mwan3.
Let me provide some more info. Here is the topology.

TO(Lte)---Managed switch1-- | -----clients
                            |
                            ---- Satellite Router with unmanaged switch -- Managed switch2 -- clients

Current lan ip's
TO: Lan 10.0.10.1
Satellite router: 10.0.10.53 lan & 88.xx.xx.xx wan
Managed switches and clients: 10.0.10.0/24

I could use the managed switches to assign all the clients to VLAN ID 1.
I could use the managed switch1 to assign the incoming satellite port to VLAN ID 1 & 2.

How should I configure TO in order to accept lan traffic from VLAN ID 1 and also create an interface (with VLAN ID 2) to be used with mwan3 that routes traffic to the satellite router?

VLAN ID 1 is set as default for all swtich ports, which are in untagged state - just run bridge v on the ssh cli to check/see.

The lan port on the TO that connects to the external switch should preferably not be enslaved in a bridge device. On that lan port, say lan4, change the VLAN ID to 2 with

bridge v a dev lan4 vid 2 pvid untagged

suppose the external swtich been configured accordingly.

If it does not work however try on TO instead

bridge v a dev lan4 vid 1 pvid untagged && bridge v a dev lan4 vid 2

root@Turris:~# bridge v
-ash: bridge: not found
root@Turris:~# opkg install bridge
Installing bridge (1.5-6) to root...
Downloading http://downloads.openwrt.org/releases/18.06.2/packages/arm_cortex-a9_vfpv3/packages/bridge_1.5-6_arm_cortex-a9_vfpv3.ipk
Configuring bridge.
root@Turris:~# bridge v
-ash: bridge: not found

is the legacy tool brctl.

Try installing instead ip-bridge => Bridge configuration utility from iproute2

In the current setup, have configured lan4 as wan though it is not used.
No VLAN ID is set.

root@Turris:~# bridge v
port	vlan ids
lan0	None
lan1	None
lan2	None
lan3	None
br-lan	None
wlan0	None

The last port (wan) was "fried" by a lightening!!!!

root@Turris:~# ip l | grep lan
5: lan0@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP mode DEFAULT group default qlen 1000
6: lan1@eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
7: lan2@eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
8: lan3@eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
9: lan4@eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
12: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
14: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP mode DEFAULT group default qlen 1000

:smirk: scrap that one, it is unusable then?

Yes, though ports 0 to 4 are fine

Right then, now it gets a bit complicated - because

  • I am not familiar with mwan3 and how it relates (WAN) firewall zones and whether it can distinguish VLAN traffic on a single TO lan port as WAN and LAN
  • your network layout
  • TO's Multi-CPU-DSA and bridge vlan_filtering

Supposedly all WAN facing ports should be in the TO's WAN firewall zone, least that would be my understanding.
Since the SAT modem-router connects to a swtich, that also hosts various LAN clients, it would not make sense to be assigned to the TO's WAN firewall zone however and likely cause firewall related issues, not sure whether/how mwan3 relates to firewall zones.
If however the SAT modem-router is not firewalled somewhere else but plugged into LAN firewall zone at the TO it would create a security risk.

From that perspective it would be sensible to run 2 wires between the external switch and the TO - one for the LAN traffic and one for the traffic with the SAT modem-router. Does that make sense and is feasible to setup?

Running a second wire is feasible but complicated for the moment as I will need to dig the ground. I assume that installing a third managed switch after the satellite router would be easier for now. Please note that only the managed switches are connected to the un-managed switch ports of the satellite router.

Though, maybe what you proposed is also doable. From what I understand from this explanation, I might be able to tag the traffic from clients using the managed switches. Then all the untagged traffic will be from the satellite router which could be assigned a PVID before reaching TO.
I will need to read a bit about VLAN configuration on my switches (TL-SG108PE) and return here.

The most straight forward way would be to plug the SAT m-r directly into the TO's lan port, but suppose that is somehow not feasible.

I would reckon even with any tagging that WAN and LAN traffic should not be mixed on the same TO port, firewall and mwan3 wise.

Yes, that is not feasible. But again this would also be a single point of hardware failure if somehow TO is "fried" or out of power.

Oh wait one, there is a way perhaps:

  • remove say lan3 from the lan bridge
  • create lan3.1 and add it to the lan bridge
  • create lan3.2 and add it to the TO's WAN firewall and use it in mwan3

configure the switch that host the SAT m-r with the necessary tagging and you should be good to go even with a single wire

Thank you, I will try this.
I will do my "homework" with the configuration of my switches and return here.

I configured my switch for vlan1. Then I created a lan0.1 on TO and added it to the lan bridge but I lost connectivity to the lan. Even if i create a new interface with lan0.1 (bridged or not) I can't connect to lan devices.
Any idea how to proceed?

Summary
bridge v a dev br-lan self vid 1 untagged pvid
RTNETLINK answers: Not supported

root@Turris:~# lsmod | grep 802
root@Turris:~# 

root@Turris:~# ubus -S call system board
{"kernel":"4.14.95","hostname":"Turris","system":"ARMv7 Processor rev 1 (v7l)","model":"Turris Omnia","board_name":"armada-385-turris-omnia","release":{"distribution":"OpenWrt","version":"18.06.2","revision":"r7676-cddd7b4c77","target":"mvebu\/cortexa9","description":"OpenWrt 18.06.2 r7676-cddd7b4c77"}}

root@Turris:~# bridge v
port	vlan ids
lan1	None
lan2	None
lan3	None
lan4	None
br-lan	None
wlan0	None
lan0.1	None

root@Turris:~# cat /proc/lan0.1
lan0.1  VID: 1	 REORDER_HDR: 1  dev->priv_flags: 1201
         total frames received            0
          total bytes received            0
      Broadcast/Multicast Rcvd            0

      total frames transmitted            0
       total bytes transmitted            0
Device: lan0
INGRESS priority mappings: 0:0  1:0  2:0  3:0  4:0  5:0  6:0 7:0
 EGRESS priority mappings: 

root@Turris:~# ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 532
    link/ether d8:58:d7:00:30:38 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 532
    link/ether d8:58:d7:00:30:36 brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 532
    link/ether d8:58:d7:00:30:37 brd ff:ff:ff:ff:ff:ff
5: lan0@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether d8:58:d7:00:30:36 brd ff:ff:ff:ff:ff:ff
6: lan1@eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether d8:58:d7:00:30:36 brd ff:ff:ff:ff:ff:ff
7: lan2@eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether d8:58:d7:00:30:36 brd ff:ff:ff:ff:ff:ff
8: lan3@eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether d8:58:d7:00:30:36 brd ff:ff:ff:ff:ff:ff
9: lan4@eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br-lan state LOWERLAYERDOWN mode DEFAULT group default qlen 1000
    link/ether d8:58:d7:00:30:36 brd ff:ff:ff:ff:ff:ff
10: wwan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether a2:e3:41:a9:2c:08 brd ff:ff:ff:ff:ff:ff
12: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether d8:58:d7:00:30:36 brd ff:ff:ff:ff:ff:ff
14: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP mode DEFAULT group default qlen 1000
    link/ether 04:f0:21:22:dc:5e brd ff:ff:ff:ff:ff:ff
31: wg0: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1360 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/none 
34: lan0.1@lan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-lan state UP mode DEFAULT group default qlen 1000
    link/ether d8:58:d7:00:30:36 brd ff:ff:ff:ff:ff:ff

That would indicate the necessary kernel build configuration flag

CONFIG_BRIDGE_VLAN_FILTERING=

not being set and thus the feature to

selectively receive and forward traffic based on VLAN information in the packet any VLAN information configured on the bridge port or bridge device.

is not working.

Even if the flag would be set it may still not be working on the TO due to


is not what I wrote


ip l and bridge bridge v serve different purposes [1] in the VLAN context.

For your use case bridge vlan filtering may not be necessary.

TOL3 = TO LAN3 port
EMS = external managed switch (that hosts the SAT and other LAN clients)
EMSpT = external managed switch port that connects by single wire to TOL3
EMSpS = external managed switch port that connects the SAT
EMSpL = = external managed switch port that connects the LAN clients

TOL3 < ---- single wire ---- > EMSpT

Now building a VLAN trunk

On the TO

/etc/config/network

config interface 'lan'
	option ifname 'lan0 lan1 lan2 lan3.1'

config interface 'vlan_EMS'
	proto='none'
	option ifname='lan3.2'

/etc/config/firewall

config zone
	option name 'wan'
	list device 'eth2'
	list device 'lan3.2'

Restart network and use lan3.2 in mwan


On the EMS

  • configure EMSpT as trunk port - tagged egress with VLAN IDs 1 and 2
  • configure EMSpS as access port - untagged egress with VLAN ID 2
  • configure EMSpL as access port - untagged egress with VLAN ID 1

[1] https://github.com/openwrt/luci/issues/2798#issuecomment-569430845

I don't have any experience with DSA but I thought it was supposed to be simple.

  • Each physical Ethernet cable port appears as an independent interface like it's a direct port into the CPU, even though there may actually be a hardware switch involved.
  • For conventional untagged "access" ports, include multiple ports in the interface in /etc/config/network.
  • For a cable to emit / receive tagged packets, add a VLAN number to the port name. Using the same port with different VLANs in different networks will build a "trunked" connection.

The config system is then supposed to abstract the device's hardware details and build out the desired topology using an optimal combination of hardware switching and software bridging. That's the pipe dream anyway.

It actually works, that said:

  • managing VLAN tagging for bridges and lan ports requires to be set
  • multi-cpu-dsa requires a patch (connect more than one CPU to the switch dev) for vlan_filtering to work
  • currently no LuCI support for managing vlan_filtering

Actually, this was my bad in switch configuration. I didn't have the port configured as tagged so the untagged traffic was not passing through. Now that the switch is correctly configured, it works as expected (even with lan0.1 where the cable is now attached). I will need to install the third switch and finish the configuration but this seems trivial now.

Thank you vary much.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.