init.d script for monitoring and adjusting route metrics of 2 WANs in a multi-WAN setup on OpenWRT. Used as a simple alternative to mwan3, where I just want failover and all traffic forwarded through wireguard vpn (mwan3 seems to struggle with this).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Thomas Lynch 81733592d2 Make change_wan_metric() get proper route based on route target of vpn gateway, upate check to match get_active_wan() 3 years ago
LICENSE Add LICENSE 3 years ago
README.md add failover.sh and failover init script 3 years ago
failover add failover.sh and failover init script 3 years ago
failover.sh Make change_wan_metric() get proper route based on route target of vpn gateway, upate check to match get_active_wan() 3 years ago

README.md

Basic Mwan

init.d script for monitoring and adjusting route metrics of 2 WANs in a multi-WAN setup on OpenWRT. Used as a simple alternative to mwan3, where I just want failover and all traffic forwarded through wireguard vpn (mwan3 seems to struggle with this).

cp failover /etc/init.d/failover
cp failover.sh /usr/bin/failover.sh
chmod +x /etc/init.d/failover
chmod +x /usr/bin/failover.sh
/etc/init.d/failover enable
/etc/init.d/failover start

The script uses logger to write to openwrt system log, which can be monitored using logread. It will log when it starts, when some pings fail, and when switching between WANs.