VPN connection watcher
Find a file
Paul M 069bdb1fca
Update README.md
Clarification on what Monit is.
2020-11-02 12:00:50 -06:00
LICENSE Initial commit 2020-11-01 21:12:32 -06:00
README.md Update README.md 2020-11-02 12:00:50 -06:00
vpnwatch Add files via upload 2020-11-01 21:18:15 -06:00

vpnwatch

VPN Watching bash script for use with OpenVPN on Openwrt

Standard bash script, requires bash install on OpenWrt and monit to be installed and configured. Monit is a system monitoring software that also trigger actions as a result of certain events. In my case monit was being used to ping the domain in this script and on potential failure this bash script was invoked. You could alternatively also use cron to trigger a check periodically.

We assume a few things when this is called, first that the VPN DNS (Expressvpn) is failing second that a restart of openvpn will fix it

Note the location of OpenVPN startup script assuming its already setup and there

Note location of startup script is /etc/init.d/openvpn We assume the OpenVPN file used to configure this connection also has script security set to 2 so we can use the up and down scripts to force the DNS to swap.

Make sure your wan port isn't setup for DHCP as some DHCP setups can cause the DNS to reset from time to time Your ISP's DHCP may not be a problem though as I only encountered this when I had another router upstream