To set up failover between the 5GHz and 2.4GHz connections on OpenWrt for the Flint 2 router, you need to configure the backhaul interfaces so that the 5GHz connection is the primary, and the 2.4GHz connection serves as a backup in case the primary fails. This can be done through interface bonding or configuring a backup wireless connection in the OpenWrt settings.
Here’s a step-by-step guide to configuring failover:
1. Access the OpenWrt Web Interface
• Open a web browser and go to the Flint 2’s IP address (typically 192.168.1.1 or 192.168.8.1).
• Log in with your username and password.
2. Configure 5GHz as the Primary Wireless Connection
• Navigate to Network -> Wireless.
• Find the 5GHz interface (usually labeled something like radio1 or wlan1).
• Ensure that this interface is connected to the Fritzbox. You may need to configure the wireless interface with the correct SSID and password of the Fritzbox’s 5GHz network.
• Under the Wireless Security tab, set the correct encryption (WPA2/WPA3) and password for the Fritzbox’s 5GHz network.
3. Configure the 2.4GHz as the Backup Wireless Connection
• Still in the Network -> Wireless section, find the 2.4GHz interface (likely radio2 or wlan0).
• Configure this interface to connect to the Fritzbox’s 2.4GHz network with the same SSID and password (if they are the same, or adjust if different).
• Make sure the Wireless Security is also properly configured for the Fritzbox’s 2.4GHz network.
4. Create a Failover Policy Using Interface Grouping
Now you need to set up the failover policy so that OpenWrt will prefer the 5GHz connection and only switch to 2.4GHz if the 5GHz connection is lost or degrades.
-
Go to Network -> Interfaces.
-
Click on Add New Interface and create two interfaces:
• One for the 5GHz backhaul connection (if not already configured).
• Another for the 2.4GHz backhaul.
-
Name the interfaces accordingly, e.g., Backhaul5GHz and Backhaul2.4GHz.
-
Assign both to the WAN firewall zone (or another relevant zone).
5. Configure MWAN3 for Failover
To handle automatic failover between the two connections, you can use the MWAN3 package in OpenWrt, which is designed for multi-WAN setups but can be used here for failover:
• Install MWAN3 (if not already installed):
-
Go to System -> Software.
-
Search for mwan3 and install the package.
• Configure MWAN3:
-
Go to Network -> Load Balancing.
-
Define your interfaces for both the 5GHz and 2.4GHz connections.
-
Set 5GHz as the primary (higher priority) by assigning it a lower metric (e.g., metric 1).
-
Set the 2.4GHz as the backup with a higher metric (e.g., metric 2).
6. Test the Setup
• Disconnect or disable the 5GHz connection temporarily to see if Flint switches over to the 2.4GHz backup.
• You can monitor this in the Status -> Overview section to confirm the failover behavior is working as expected.
Optional: Script-based Failover
For more control or custom setups, you can create a custom script that continuously pings an external IP (like Google’s DNS 8.8.8.8) and, upon failure of the primary 5GHz connection, automatically switches to the 2.4GHz backhaul.
Here’s a basic outline of how the script would work: