I have installed mwan3 to implement fail-over across three internet connections. It works great if I unplug or plug back the WAN cables. But if the WAN access is lost due to another issue, for instance the internet connectivity is lost, then:
The corresponding WAN interface is correctly marked as down in the MultiWAN status
From the router, I can ping any internet IP, so the fail-over worked somehow
However, I cannot ping any internet IP from the clients behind the router
In case it makes a difference, I do not use the default LAN interface and bridge created by OpenWRT (192.168.1.0/24). I have defined my own (V)LAN networks. All three WAN interfaces belong to the “WAN” firewall zone with masquerade, internet access from the LAN networks works fine when I unplug the other cables. And: it is an IPv4 only setup.
I have tried to troubleshoot, but the mechanisms used and well documented by mwan3 are beyond my understanding. I thought that given the specific symptoms, someone might point my in the right direction? I would be grateful for any hint.
@pavelgl I did not manage to get the information you asked for yet, sorry. I have only intermittent access to the device. Hopefully the information provided by @jaimedb will help. Otherwise, I will post mine after the holiday. Thanks for your help!
This cannot be debugged without posting the requested information.
It would also be good to see the OpenWrt version used.
ubus call system board
The same in what way?
You are using mwan3 in load balancing, not failover mode.
When a failure occurs, can you ping public IPs from the router itself?
The network and mwan3 configurations look correct, but we haven't seen the firewall settings.
Thanks a lot for looking into it. All 3 WAN interfaces are in different subnets. If I remember correctly, 192.168.2, 192.168.6 and 192.168.178. They all use a different router and ISP. It means that I have a double-NAT, unfortunately. One in OpenWRT, and one in the ISP router. But since the failover works when I unplug a cable, I don’t think it is the issue.
I did some more experiments today. To summarize, what is useful is to monitor the state of the mwan3 interfaces using:
$ mwan3 interfaces
e.g.:
Interface status:
interface wana is online and tracking is active (online 00h:00m:57s, uptime 00h:00m:57s)
interface wanb is online and tracking is active (online 00h:00m:52s, uptime 00h:00m:53s)
interface wanc is online and tracking is active (online 00h:00m:51s, uptime 00h:00m:53s)
Interface status:
interface wana is disconnecting and tracking is active
interface wanb is online and tracking is active (online 00h:03m:35s, uptime 00h:03m:36s)
interface wanc is online and tracking is active (online 00h:03m:34s, uptime 00h:03m:36s)
Interface status:
interface wana is offline and tracking is active
interface wanb is online and tracking is active (online 00h:08m:15s, uptime 00h:21m:45s)
interface wanc is online and tracking is active (online 00h:08m:15s, uptime 00h:21m:45s)
When blocking internet traffic on the upstream "wana" router:
the transition from "online" to "disconnecting" takes around 10-20 seconds for wana, which is compatible with my settings (1 ping, ping interval 10 seconds, ping timeout 4 seconds).
in the "disconnecting" state, LAN clients have no internet access
the transition from "disconnecting" to "offline" takes around 2 minutes
once "wana" is offline, traffic goes through "wanb" as expected
When unplugging the "wana" upstream cable:
the transition from "online" to "disabled and tracking is paused (23)" occurs within a few seconds
LAN clients have almost no interuption of internet access
So the main question is know why it takes so long to go from "disconnecting" to "offline".
Also, I am not sure how I should configure "Flush conntrack table" ("Flush global firewall conntrack table on interface events") for my 3 mwan3 interfaces:
empty (current state)
ifup (netifd)
ifdown (netifd)
connected (mwan3)
disconnected (mwan3)
I guess it influences also the failover time from the client perspective.
Pavel, I will send you more information by PM. Thanks again for you help!