wanmonitor/README.md

61 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

2018-04-26 19:04:32 +02:00
# WAN Monitor & Failover Connection Manager
2018-04-26 19:15:24 +02:00
The wanmonitor package is an agent script that makes Multi-WAN configuration simple,
easy to use and manageable. It comes complete with failover setup supporting many
types of internet connections, including PPPoE and mobile connections. The uci
2018-07-12 06:48:03 +02:00
configuration file /etc/config/wanmonitor is provided as part of the wanmonitor package.
2018-04-26 19:15:24 +02:00
The WanMonitor provides the following capabilities:
* provides outbound WAN traffic failover connection setup
* monitors primary link by checking interface status and repeated ping tests
* automatically routes outbound traffic to secondary WAN interface if primary is down
* automatically routes outbound traffic back to primary interface when it is available again
* easy to use and manageable configuration via single file
2018-07-12 06:48:03 +02:00
* up to 2 physical interfaces for easy failover setups
2018-04-26 19:15:24 +02:00
2018-04-26 19:04:32 +02:00
# Configuration
2018-04-23 11:19:34 +02:00
All configuration is done in /etc/config/wanmonitor file. Options available:
* check_host - IP address of remote host used to check Internet connectivity
2020-02-29 19:35:16 +01:00
* flapping - Number of seconds to wait after switching WAN to reduce link flapping
2018-04-23 11:19:34 +02:00
* interval - Number of seconds to wait between checks
2018-04-23 17:40:01 +02:00
* sleep - number of seconds to wait for slow links during startup
2018-04-23 11:19:34 +02:00
* wan_primary - Primary WAN interface name to use
* wan_secondary - Secondary WAN interface name to use
2018-04-26 19:04:32 +02:00
What is more it can make a use of WAN routes metrics set in /etc/config/network,
thus allowing to use PPPoE to work correctly. When PPPoE connection is established,
it automatically adds a route with proper (higher) priority and this connection
is being used as default. After a while, when WanMonitor notices primary connection
is again available, it removes a route for secondary WAN connection (eg. in order to
save mobile traffic).
# Sample configuration
/etc/config/network:
2018-07-11 16:06:04 +02:00
config interface 'wan1'
2018-04-26 19:04:32 +02:00
option ifname 'eth0'
option metric '0'
option proto 'pppoe'
option username 'login'
option password 'password'
option service 'PPPoE'
2018-07-11 16:06:04 +02:00
config interface 'wan2'
2018-04-26 19:04:32 +02:00
option ifname 'eth1'
option proto 'dhcp'
option metric '5'
option defaultroute '0'
2018-07-11 16:06:04 +02:00
option service 'LTE'
2018-04-26 19:04:32 +02:00
/etc/config/wanmonitor:
2018-07-11 16:06:04 +02:00
config wanmonitor
2018-04-26 19:04:32 +02:00
option check_host '8.8.8.8'
2020-02-29 19:35:16 +01:00
option flapping '60'
2018-04-26 19:04:32 +02:00
option interval '5'
option sleep '5'
option wan_primary 'wan1'
2018-07-11 16:06:04 +02:00
option wan_secondary 'wan2'