Adze1502 / mwan

Simple policy routing for multiple WANs in OpenWrt
84 stars 24 forks source link

mwan3 connection status does not recover sometimes #12

Closed alhashash closed 10 years ago

alhashash commented 10 years ago

I have an OpenWRT TP-Link TL-WDR4300 router connected to an ADSL router. When I power cycle both devices, there is a 50% chance that WAN1 connection status stays down despite that Internet is reachable from the router. Restarting mwan3 service resolves the issue.

I tracked the problem and found the following:

several hotplug event occurs that starts other instances the connection tracker. New tracker kills older ones.

The tracker starts by pinging tracking IPs. If the ping is successful, it does not try to make sure that the wan (route) status is currently up. Here is the problem: if the status was down in the old tracker and the new tracker can reach the internet, the status stays down indefinitely (unless internet connection goes down and up again).

I suggest one of the following solutions:

1- Exit from new tracker instead of killing the old tracker (may check if the process is alive) 2- Check the wan status and change it (/sbin/hotplug-call) if it does not match the actual status.

Adze1502 commented 10 years ago

New mwan3track process kills old process. A new mwan3track process is initiated from mwan3 hotplug event and only on UP events.

Your quote "The tracker starts by pinging tracking IPs. If the ping is successful, it does not try to make sure that the wan (route) status is currently up."

The new tracker is spawned from a hotplug event and mwan3 should just have updated the new rules and tables.

Your quote "If the status was down in the old tracker and the new tracker can reach the internet, the status stays down indefinitely (unless internet connection goes down and up again).

Again right before the new mwan3track process was spawned, mwan3 hotplug event should have setup rhe correct rules and tables.

There maybe something else wrong, but is not this...