Page 1 of 1

How to make OpenVPN warn me before disconnecting?

Posted: Tue Dec 22, 2015 12:17 pm
by maio
I have been using OpenVPN command line tool in Linux Mint 17.2 with PrivateTunnel server (free account).
I downloaded a config file and just started the VPN with:

Code: Select all

sudo openvpn MyConfigFile.ovpn
Free accounts only have 500 MB of data usage and I noticed that when my data was used up, I was disconnected without any warning.
I just continued using the internet without knowing that I wasn't inside the VPN anymore.

Is there an option I can add to the openvpn command (or the config file) to either give me a warning that I am about to be disconnected...or to knock me offline completely when the vpn disconnects..or something like that?

(I have network-manager-openvpn-gnome installed but when I use openvpn in the terminal I don't get notifications, and I would like to.)

Re: How to make OpenVPN warn me before disconnecting?

Posted: Wed Jan 06, 2016 4:29 pm
by dazo
Have a look at --down and --route-pre-down options in the man page. These script hooks can be used to kick off a script or an executable when openvpn is shutting down.

https://community.openvpn.net/openvpn/w ... nPage#lbAR

Re: How to make OpenVPN warn me before disconnecting?

Posted: Sun Oct 09, 2016 4:43 pm
by wknapik
Hi. I implemented IP leak prevention / failsafe as an --up/--down script. Works fine for me so far. Feel free to give it a go - https://github.com/wknapik/vpnfailsafe . I'm looking for feedback, so do get in touch on GitHub if you have comments, good or bad ;] Cheers.