Failover to WWAN if WAN is down or not available?

Hey all,

I Installed 19.07.4 a couple of days and I'm still learning all that I can do with it, but my main goal that I'm trying to achieve is not working as I hoped.

Basically, I have WWAN connected to a different network that uses a captive portal which works fine when I connect to SSID: OpenWrt (ie. 2.4 GHz) using my laptop. Using another home router I have an internet connected to WAN port and as soon as I connect it switches to that and it stops using WWAN which is fine and it works using that connection but, as soon as I hit stop WAN under Network > Interfaces internet is gone and even after waiting 10+ minutes while connected to OpenWrt it does not know that WAN is down and it needs to use available WWAN internet connection.

What about if my other router internet goes out?
It would be great if there would something that would ping public IP every 20 seconds or so and if there's no response switch to WWAN and provide internet to OpenWrt SSID.
I've tried changing a few things but reverted back since it did not achieve the desired effect.
Before I screw up something really bad that it needs full reset I wanted to ask if anyone knows a solution to this :grinning:

1 Like

Thank you! I will give this a try!

1 Like

Ok, so I spent better part of the day trying to follow the guide and searching on this forum but I can't get interface to start nor do I quite understand how to include currently connected wlan. I've tried including wwanRepeat and wlan0 what is the true name of the wireless interface?
What is an example of /etc/config/network config?

MWAN - Interfaces
There are currently 6 of 60 supported interfaces configured
WARNING: Interface wwanRepeat has no default route in the main routing table
WARNING: Interface wanb6 are not found in /etc/config/network
WARNING: Interface wanb are not found in /etc/config/network
WARNING: Interface wlan0 are not found in /etc/config/network
WARNING: Interface wan6 has no default route in the main routing table

Hopefully someone will be able to point me in the right direction.
TIA!

Interface status:
 interface wan is online 00h:09m:48s, uptime 00h:49m:03s and tracking is active
 interface wan6 is offline and tracking is down
 interface wanb is offline and tracking is down
 interface wanb6 is offline and tracking is down
 interface wwanRepeat is offline and tracking is down
 interface wlan0 is offline and tracking is down
root@OpenWrt:~# cat /etc/config/network

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

config globals 'globals'
        option ula_prefix 'fda4:94a1:5d89::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth1.1'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ipaddr '192.168.2.1'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'
        option type 'bridge'
        option metric '10'

config interface 'wan6'
        option ifname 'eth0.2'
        option proto 'dhcpv6'

config switch
        option name 'switch0'
        option reset '1'
        option enable_vlan '1'

config switch_vlan
        option device 'switch0'
        option vlan '1'
        option ports '1 2 3 4 6t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '5 0t'

config interface 'wwanRepeat'
        option proto 'dhcp'
        option metric '20'

root@OpenWrt:~#
root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 78:D2:94:48:47:FA  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::7ad2:94ff:fe48:47fa/64 Scope:Link
          inet6 addr: fda4:94a1:5d89::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11383 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14213 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2785377 (2.6 MiB)  TX bytes:8895811 (8.4 MiB)

br-wan    Link encap:Ethernet  HWaddr 78:D2:94:48:47:FB  
          inet addr:192.168.1.204  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::7ad2:94ff:fe48:47fb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:15846 errors:0 dropped:134 overruns:0 frame:0
          TX packets:9985 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8428390 (8.0 MiB)  TX bytes:2562678 (2.4 MiB)

eth0      Link encap:Ethernet  HWaddr 78:D2:94:48:47:FB  
          inet6 addr: fe80::7ad2:94ff:fe48:47fb/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18763 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9992 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8920459 (8.5 MiB)  TX bytes:2603428 (2.4 MiB)
          Interrupt:31 

eth0.2    Link encap:Ethernet  HWaddr 78:D2:94:48:47:FB  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16089 errors:0 dropped:201 overruns:0 frame:0
          TX packets:9985 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8475546 (8.0 MiB)  TX bytes:2562678 (2.4 MiB)

eth1      Link encap:Ethernet  HWaddr 78:D2:94:48:47:FA  
          inet6 addr: fe80::7ad2:94ff:fe48:47fa/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:936 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:162006 (158.2 KiB)
          Interrupt:32 

eth1.1    Link encap:Ethernet  HWaddr 78:D2:94:48:47:FA  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:918 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:156538 (152.8 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:1821 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1821 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:172541 (168.4 KiB)  TX bytes:172541 (168.4 KiB)

wlan0     Link encap:Ethernet  HWaddr 78:D2:94:48:47:FC  
          inet6 addr: fe80::7ad2:94ff:fe48:47fc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:55 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2530 (2.4 KiB)  TX bytes:886 (886.0 B)

wlan0-1   Link encap:Ethernet  HWaddr 7A:D2:94:48:47:FC  
          inet6 addr: fe80::78d2:94ff:fe48:47fc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11789 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14783 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2929186 (2.7 MiB)  TX bytes:9242022 (8.8 MiB)

wlan0-2   Link encap:Ethernet  HWaddr 7E:D2:94:48:47:FC  
          inet6 addr: fe80::7cd2:94ff:fe48:47fc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:916 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:172190 (168.1 KiB)

wlan1     Link encap:Ethernet  HWaddr 78:D2:94:48:47:FD  
          inet6 addr: fe80::7ad2:94ff:fe48:47fd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:236 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1106 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:50289 (49.1 KiB)  TX bytes:256145 (250.1 KiB)

wlan1-1   Link encap:Ethernet  HWaddr 7A:D2:94:48:47:FD  
          inet6 addr: fe80::78d2:94ff:fe48:47fd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1572 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:407182 (397.6 KiB)

root@OpenWrt:~# /usr/sbin/mwan3 restart


Anyone? Please let me know if I need to clarify anything.