vpn

OpenVPN keeps disconnecting with an inactivity timeout

I’ve used openvpn on Mac (using Tunnelblick) for a few years for a home->work VPN connection with no issues, and suddenly today, it would disconnect me every two minutes.

This seems a very accurate timing problem, so can’t be ISP related surely? But I could not find the issue anywhere. Rebooted Mac and the router, still the same.

So, I just managed to get the same VPN working recently on a Debian based Linux box using the command line version of openvpn – and that outputs all the logs to the terminal. I thought I’ll give that a go in case it yields any helpful information.

Anyway, the error that stuck out was this one:

Wed May 25 19:32:30 2016 ERROR: Linux route add command failed: external program exited with error status: 2
Wed May 25 19:32:30 2016 Initialization Sequence Completed
Wed May 25 19:34:30 2016 [chris] Inactivity timeout (--ping-restart), restarting
Wed May 25 19:34:30 2016 SIGUSR1[soft,ping-restart] received, process restarting

And a quick search on Google took me to this chap : http://www.drmaciver.com/2012/05/openvpn-repeatedly-losing-connections-with-inactivity-timeout/ which said he had an inactive openvpn connection.

Perhaps my Linux box has got it stuck open? It wasn’t connected until just now, but lets reboot the machine anyway (it never gets rebooted as its a media server)

Lo and behold, it sorts out the issue, so the Debian based machine had been connected to the VPN, even though all the terminal windows had been closed. Naughty…

Saving username and password OpenVPN config

I use the openvpn command line to connect to a certain VPN site, and I get annoyed at having to find the password everytime

So, in the .ovpn file, there is a setting:

auth-user-pass

So, I create a file (lets call it new-file.txt) in the same folder as the config, and it only contains 2 lines, first line username, second password

Change the auth-user-pass line to be

auth-user-pass new-file.txt

And now it connects without prompting me for password. Super.

Obviously this is a slight security issue, but this is on a pretty secure VM on a secure machine. So its quite safe. Just think about it if you are implementing the same workaround.

VPNetMon – close programs when VPN drops

If you are using a VPN to securely download files, whether it be for anomynous reasons or anything else, if the VPN connection gets dropped, your PC may revert to an unsecured connection to continue the operation.

VPNetMon is an application that montors your VPN connection and if it drops, the application can be configured to close certain apps.

So if you are using a BitTorrent client and using an anonymous VPN connection to download content this will make you feel much more secure indeed.

You can get it at http://vpnetmon.webs.com/