News OpenWRT - Linux OS for Routers - Thread

Wanted to ask if OpenWRT handles this better - meaning if the primary is still good - does the internet connectivity stay up if secondaries drop - I mean no interruptions etc?
When you are load balancing across multiple links, sessions will be distributed depending on the algorithm in use. If one of the links goes down, the sessions over that link will reach timeout and new sessions will have to be established over the links that are up. This behaviour will be the same in case of Openwrt too
 
  • Like
Reactions: vishalrao
When you are load balancing across multiple links, sessions will be distributed depending on the algorithm in use. If one of the links goes down, the sessions over that link will reach timeout and new sessions will have to be established over the links that are up. This behaviour will be the same in case of Openwrt too

What if I just want to avoid load balancing and do only "3-level" failover? Meaning I have 3 links - WAN1, WAN2 and WAN3... can OpenWRT handle them in that order of preference? Meaning it will use the higher WANx that is up and only failover to the next available link? And also failback to the higher link when it comes back online? What is the typical lag during failover/failback?
 
Anyone using SQM on openwrt? bufferbloat teat is showing only 5-6ms additional latency so not sure if SQM (NSS or software) will help
 
What if I just want to avoid load balancing and do only "3-level" failover? Meaning I have 3 links - WAN1, WAN2 and WAN3... can OpenWRT handle them in that order of preference? Meaning it will use the higher WANx that is up and only failover to the next available link? And also failback to the higher link when it comes back online? What is the typical lag during failover/failback?
The mwan3 package does failover by default. Don't know about the lag.

Mwan3 is a feature in OpenWrt that simplifies managing multiple WAN connections, including load balancing and failover. It allows you to switch between primary and backup internet connections if the primary one fails. With mwan3, you can configure up to 250 WAN interfaces and define which traffic goes through which interface. [1, 2, 3, 4]
Here's a more detailed look at mwan3 and failover:

• Failover: mwan3 can automatically switch to a secondary WAN connection when the primary connection is down, ensuring continued internet access. [2, 5]
• Multiple WAN: You can configure multiple WAN interfaces (e.g., 3 ISPs) and mwan3 will manage which one is used for traffic based on your configuration. [4, 6]
• Load Balancing: mwan3 can also be used to balance traffic across multiple WAN connections, distributing it based on factors like speed or availability. [2, 4]
• Configuration: You configure mwan3 using the OpenWrt web interface or by editing the mwan3.conf file. [4, 7]
• Status: You can use the command mwan3 status to view the current state of each WAN interface and the active traffic routing. [4]

Example Scenario:
Let's say you have three WAN connections: WAN1 (primary), WAN2 (backup), and WAN3 (another backup). You configure WAN1 as the primary connection and WAN2 as the backup. If WAN1 goes down, mwan3 will automatically switch to WAN2. You can further configure WAN3 as a failover for WAN2 or as a load-balanced option with WAN2. [4, 5, 6, 8]

AI responses may include mistakes.

[1] https://github.com/openwrt/packages/issues/12309[2] https://openwrt.org/docs/guide-user/network/wan/multiwan/mwan3[3] https://www.fortinet.com/resources/cyberglossary/failover[4] https://forum.archive.openwrt.org/viewtopic.php?id=39052[5] https://www.asus.com/support/faq/1050124/[6] https://www.draytek.co.uk/support/guides
/kb-wan-backup


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
 
  • Like
Reactions: vishalrao
What if I just want to avoid load balancing and do only "3-level" failover? Meaning I have 3 links - WAN1, WAN2 and WAN3... can OpenWRT handle them in that order of preference? Meaning it will use the higher WANx that is up and only failover to the next available link? And also failback to the higher link when it comes back online? What is the typical lag during failover/failback?
i have done this the interpretations was unnoticeable
 
  • Like
Reactions: vishalrao
The cheapest option would be dfrobot dual ethernet with raspberry pi CM4.
https://robu.in/product/dfrobot-raspberry-pi-compute-module-4-iot-router-carrier-board-mini/
It may be hard to find CM4 in stock anywhere, but even 1GB RAM would be sufficient to run openwrt. With this you can achieve A+ on bufferbloat test.
More details can be found in https://www.jeffgeerling.com/blog/2021/two-tiny-dual-gigabit-raspberry-pi-cm4-routers.
I think at this price point (2.3k + 3.8k (for CM4) + case + microsd) one can just get the NanoPi R2S Plus or the NanoPi R3S. and if the budget can be stretched a bit further then even a NanoPi R5C.

 
i have done this the interpretations was unnoticeable
What if I just want to avoid load balancing and do only "3-level" failover? Meaning I have 3 links - WAN1, WAN2 and WAN3... can OpenWRT handle them in that order of preference? Meaning it will use the higher WANx that is up and only failover to the next available link? And also failback to the higher link when it comes back online? What is the typical lag during failover/failback ?
I think this will depend on the applications that you use. Casual browsing which doesn't have session persistence will not be affected by a failover. As you click on a hyperlink, typically a new sesion is opened and the session will be established over the active link. In this case you wouldn't notice a failover has happened. In a case where you have an application which establish sessions which are maintained for long, it has to reach the timeout before it reconnects over the active link
 
  • Like
Reactions: vishalrao
yea like maybe zoom chat will notice immediately that a failover/failback is happening - wondering how long it takes on openwrt - will check the mwan3 settings/how it works.

on my tplink er605 (based on some old openwrt i believe) it takes like maybe 30 seconds to recover.

i did try openwrt with 2 wans on my routerpc - iirc it was like much faster - 5 seconds!