Add second wan IPQ40xx Device for mwan3 multi-WAN routing

I have a Linksys EA8300 router running 23.05; I'm trying to configure mwan3 failover between 2 ISPs; the primary is working fine on the WAN port, but my secondary port doesn't work - it doesn't get an IP via DHCP; nor does a static IP work on that port.

There are lots of historical discussions about oddities in IPQ40xx devices, but most of those are using swconfig, so the fixes don't translate obviously to DSA (at least, the transfer isn't obvious to me).

Some of those older discussions seem to indicate that later OpenWRT builds and/or DSA should work more smoothly, but maybe that hasn't panned out?

At least one former thread discusses IPQ40xx and DSA, but the discussion there is around VLANs and Wifi networks, and I didn't find anything applicable to multi-WAN setup (Using VLANs on ipq40xx device and DSA - #4 by psherman)

Configuration history and details:

  1. Installed 22.03
  2. Set kernsize 500000 and upgraded to 23.05.2 (as described at https://openwrt.org/toh/linksys/ea8300)
  3. Removed port 4 from LAN bridge (Network -> Interfaces -> Devices -> br-lan -> Configure ...)
  4. Added VLAN; base device = lan4, VLAN ID = 4
    (avoiding 1 and 2, which are 'special' on IPQ40xx devices - e.g. see IPQ40xx Switch Config "Strangeness" (swconfig))
  5. Added wanb network interface (Network -> Interface -> Add ...)
    Protocol = DHCP Client; Device = lan4.4
  6. Configured Gateway Metrics (wan = 10; wanb = 20)
  7. Assigned wanb to wan firewall zone
  8. Plugged in secondary network to LAN4 port.

/var/log/messages shows:

Nov 29 03:07:25 Router kernel: [905442.375904] qca8k-ipq4019 c000000.switch lan4: Link is Up - 100Mbps/Full - flow control rx/tx

But we don't ever get an IP address. See full /etc/config/network and other debugging output below.

Other things I tried:
A) Connected the secondary ISP connection in the primary WAN port; and that works fine. So I know the secondary ISP DHCP and routing is OK.

B) Configured lan4 to use a different MAC address than the lan1..lan3 and wan devices (...:FA instead of WAN ...:F8 and LAN ...:F9). In case sharing a MAC between the 3 bridged ports and the newly-assigned wanb port might be confusing something. That didn't seem to make any difference, so I reverted that change.

C) Set a static IP on lan4.4 (that connection goes to a neighbor's network, so I know the valid IP range, and I can bypass DHCP). Pinging that upstream router fails (ping -c 1 -I lan4 192.168.1.1). I reverted that change as well.

D) Tried a similar configuration on LAN port 3 (in case port 4 was somehow damaged)

What should I try next?

=====

Side question, to further display my ignorance, I'm unclear about the role of a VLAN in configuring multiple WAN interfaces.

I understand VLAN tagging to multiplex 2+ logical networks over a single wire (e.g. separate home and guest networks, multiplexed between 2+ wireless access points). But I don't have a good understanding of why VLAN tagging is necessary within the router (the CPU could apply a VLAN tag to packets arriving on (e.g.) port 4. The CPU presumably already knows which port the packet came in on, so it's unclear to me who consumes the VLAN tags). I'm happy to follow the mwan3 recipes, but if anyone can explain the role the VLAN plays, I'd love to learn something.

==================================

# cat /etc/config/network

config interface 'loopback'
	option device 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fde7:7126:4b87::/48'

config device
	option name 'br-lan'
	option type 'bridge'
	list ports 'lan1'
	list ports 'lan2'
	list ports 'lan3'

config device
	option name 'lan1'
	option macaddr '24:f5:a2:09:43:f9'

config device
	option name 'lan2'
	option macaddr '24:f5:a2:09:43:f9'

config device
	option name 'lan3'
	option macaddr '24:f5:a2:09:43:f9'

config device
	option name 'lan4'
	option macaddr '24:f5:a2:09:43:f9'

config interface 'lan'
	option device 'br-lan'
	option proto 'static'
	option ipaddr '192.168.2.1'
	option netmask '255.255.255.0'
	option ip6assign '60'

config device
	option name 'wan'
	option macaddr '24:f5:a2:09:43:f8'

config interface 'wan'
	option device 'wan'
	option proto 'dhcp'
	option metric '10'

config interface 'wan6'
	option device 'wan'
	option proto 'dhcpv6'

config device
	option type '8021q'
	option ifname 'lan4'
	option vid '4'
	option name 'lan4.4'

config interface 'wanb'
	option proto 'dhcp'
	option device 'lan4.4'
	option hostname '<redacted>-router'
	option metric '20'

==================================
With secondary ISP Ethernet cable unplugged; looks about as expected:

# ip addr list
 
...
6: lan4@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 24:f5:a2:09:43:fa brd ff:ff:ff:ff:ff:ff permaddr 00:03:7f:ba:db:ad
...
23: lan4.4@lan4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 24:f5:a2:09:43:fa brd ff:ff:ff:ff:ff:ff

==================================
With cable connected to port 4; we see a network link, but no address:

# ip addr list
...
6: lan4@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 24:f5:a2:09:43:f9 brd ff:ff:ff:ff:ff:ff permaddr 00:03:7f:ba:db:ad
    inet6 fe80::26f5:a2ff:fe09:43f9/64 scope link
       valid_lft forever preferred_lft forever
...
 23: lan4.4@lan4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 24:f5:a2:09:43:fa brd ff:ff:ff:ff:ff:ff
    inet6 fe80::26f5:a2ff:fe09:43fa/64 scope link tentative
       valid_lft forever preferred_lft forever

==================================
Routing

# ip route show
default via 50.109.232.1 dev wan proto static src 50.109.237.233 metric 10
50.109.232.0/21 dev wan proto static scope link metric 10
192.168.2.0/24 dev br-lan proto kernel scope link src 192.168.2.1

delete this

config device
	option type '8021q'
	option ifname 'lan4'
	option vid '4'
	option name 'lan4.4'

config device
	option name 'lan4'
	option macaddr '24:f5:a2:09:43:f9'

edit:

config interface 'wanb'
	option proto 'dhcp'
	option device 'lan4'
	option hostname '<redacted>-router'
	option metric '20'

in the dsa environment you just need to remove the correct ethernet port and then create a new "wanb" interface

​example remove lan1 for assign it wanb

Should I infer from your suggestion that mwan3 with DSA doesn't require a VLAN any longer? (all pre-DSA recipes called for a VLAN). If so, I guess that would answer my side question about why a VLAN is required :slight_smile:

I'll give that a try.

1 Like

yes unless for example your modem/ont needs a specific vlan to work

ps:

if you had to do the same thing with swconfig you would have had to create a vlan to assign to the second wan (much more complicated than in the DSA environment thanks to the developers)

Yes - all the mwan3 recipes I tried to follow used a VLAN. They must all be pre-DSA. Hopefully this will help someone else in a similar spot.

Thanks a bunch for your help; I can ping Internet hosts via the secondary WAN now; on to mwan3 configuration.

1 Like