Multiple WAN failback
Posted: Fri Jul 02, 2021 9:25 pm
I have multiple WANs on my OpenVPN server, but only one that's really any good. The other WANs are for emergency backup purposes, much slower and less reliable. Currently, my OpenVPN clients are connecting only to the primary WAN, however, recently, the primary WAN has suffered more outages than usual. I'd like to set up multiple 'remote' directives in the clients to failover to OpenVPN server's backup WANs when the primary WAN is unavailable. However, I'd also like the clients to failback to the primary WAN as soon as possible after it becomes available again, as the secondary WANs are much worse and really only barely usable. I'd also like to do this in a way which doesn't cause OpenVPN to have regular gaps in service availability. E.g. one way to configure the failback would be to kill the OpenVPN client process every minute, but that would cause constant gaps in service availability while the client reconnected after every 'kill'. Even killing the client every half an hour would cause regular service gaps. Perhaps some background process which checks the client's log files to see which WAN it is connected to and which pings the server's primary WAN regularly and if the primary WAN responds to pings and the client is connected to a secondary WAN, it kills the client? Is there a good/better way to do this? Thank you.