How to make OpenVPN warn me before disconnecting?

This is where we can discuss what we would like to see added or changed in OpenVPN.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
maio
OpenVpn Newbie
Posts: 1
Joined: Tue Dec 22, 2015 9:53 am

How to make OpenVPN warn me before disconnecting?

Post by maio » Tue Dec 22, 2015 12:17 pm

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.)

User avatar
dazo
OpenVPN Inc.
Posts: 155
Joined: Mon Jan 11, 2010 10:14 am
Location: dazo :: #openvpn-devel @ libera.chat

Re: How to make OpenVPN warn me before disconnecting?

Post by dazo » Wed Jan 06, 2016 4:29 pm

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

wknapik
OpenVpn Newbie
Posts: 3
Joined: Sun Oct 09, 2016 4:21 pm

Re: How to make OpenVPN warn me before disconnecting?

Post by wknapik » Sun Oct 09, 2016 4:43 pm

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.

Post Reply