MWAN3, a Multi WAN plugin for OpenWrt, can experience lag or delayed failover due to various factors, including interface quality checks, connection testing, and the configuration of failback mechanisms. To address this, users can adjust the failure interval, recovery interval, and check_quality settings within the MWAN3 configuration. Additionally, using a custom script (/etc/mwan3.user) allows for more granular control over the failover process and can help optimize the failback behavior. [1, 2, 3]
Here's a more detailed breakdown:
1. Understanding the Causes of Failover Lag:
• Interface Quality Checks: MWAN3 can be configured to assess the quality of a WAN interface before activating it. This involves metrics like packet loss and latency, which can introduce a delay during failover. [2, 3]
• Connection Testing: MWAN3 tests the connection by sending ICMP echo requests (pings) to a specified IP address. If the test fails, the interface is marked as down, triggering a failover. [3]
• Failback Delay: The failback process (switching back to the primary WAN when it recovers) can also introduce delays. This is often configured to prevent the router from repeatedly switching between interfaces due to temporary network issues. [2]
• Static Routes: If you are using static routes to control which WAN interface is used for specific destinations, those routes might also impact failover behavior. [1, 4]
2. Solutions for Addressing Failover Lag:
• Adjust Failure and Recovery Intervals: Increase the failure_interval (the time it takes for an interface to be considered down) and recovery_interval (the time it takes for a failed interface to be considered back up) settings in the MWAN3 configuration. [2]
• Use check_quality options: Configure MWAN3 to use additional quality checks, such as packet loss and latency, to ensure the link is stable before activating it. [2, 3]
• Implement a Custom Script (/etc/mwan3.user): This script allows you to execute custom commands before and after MWAN3's failover events, enabling more precise control over the failback process. [2]
• Configure Static Routes: If necessary, use static routes to force specific traffic to use a particular WAN interface, which can prevent unexpected failover behavior. [1, 4]
• Disable IPv6 Dual Stack (if applicable): IPv6 dual stack configuration can sometimes interfere with MWAN3's failover functionality, especially when using load balancing or failover. [5]
• Disable RA and DHCPv6: If using dual stack, disabling Router Advertisement (RA) and DHCPv6 on the LAN interface can help resolve issues. [5]
3. Troubleshooting:
• Check MWAN3 Logs: Review the MWAN3 logs for any error messages or warnings related to the failover process. [2]
• Monitor Interface Status: Use the mwan3track command to monitor the status of your WAN interfaces, including packet loss and latency. [2, 3]
• Test Failover: Manually disconnect the primary WAN interface to simulate a failover scenario and observe the behavior of the router. [6]
By understanding the potential causes of failover lag and implementing the appropriate solutions, you can optimize MWAN3's failover performance and ensure a more reliable network experience.
This video demonstrates how to configure MultiWAN Failover with mwan3 on OpenWRT:
(
)
AI responses may include mistakes.
[1]
https://github.com/openwrt/packages/issues/12800[2]
https://wiki.turris.cz/en/howto/multiwan[4] https://github.com/openwrt/packages/issues/17038[5] https://community.teltonika.lt/t/failover-mwan3-dual-stack-ipv4-v6-on-only-lte-interface/2490[6] https://github.com/
openwrt/packages/issues/11406