Most of us using a VPN connection to our workplace have had the secure connection occasionally drop. When that occurs and we don't notice, all of the connections applications make to our office go unsecured and become prone to malicious snooping. More often than not we cannot afford that, which is why we never leave a computer connected via VPN unattended or we employ other inconvenient schemes to avoid information leakage.
What we have here is a simple open source tool for Ubuntu that monitors the state of your VPN connection. Whenever your connections drops, vpnmon will either immediately disable your entire networking, or it will execute a custom command in case you provided one. The tool will also display a notification whenever it takes an action.
Unfortunately I haven't packaged vpnmon for Ubuntu yet, but I may end up doing that in the future. For now you can follow the steps below. They were tested on Ubuntu 12.04, but should also work on most recent version as well:
Make sure to test it out and make sure it works before leaving your VPN connection unattended. That's about it!
The source for vpnmon can be found here. Please do not hesitate to fork it, modify it or do whatever else permissible by the license. You can also email me if you encounter any issues I may be able to help with.
Random Culprits >