Friday, February 13, 2015

OpenVPN with two simple commands

In the previous blog post, I wrote about Cisco VPN. Now here is the same thing with OpenVPN.

It also contains a little trick I have to use because I can't manage to get the DNS configuration right after connecting. (I need to access the DNS server internal to the LAN I am connecting to.)

Here's the connect.sh script:



And here's the disconnect.sh script:



To make the scripts work, you have to put them in the same folder than your OpenVPN configuration file (here named "client.conf"). This directory must also contain a valid "resolv.conf" file that will be used when the VPN connection is up and running.

As in the previous article, you can execute connect.sh and then close the terminal.
I advise you to create aliases to these scripts. The scripts are made so that you can run them from any directory.

No comments:

Post a Comment