The instructions below assume a Debian based distro. Please substitute as neccessary.
- Install OpenVPN using your package manager.
sudo apt-get install openvpn
- Download the OpenVPN config files to your home directory and extract the contents.
- You can initiate an OpenVPN connection by simply specifying the configuration file you wish to use.
need to manually enter your VPN username and password.
/sbin/openvpn --config Germany.ovpn
- The remainder of this guide assumes you want to run OpenVPN as a service/daemon.
Copy the .ovpn file to
sudo cp ~/ivpn-openvpn-config/Germany.ovpn /etc/openvpn/
- If you wish to save your username/password, create a text file
/etc/openvpn/passand enter your username on the first line (starts with 'ivpn') and your password on the 2nd line. Then edit the .ovpn file you copied in the previous step and change the line
- If you wish to use the IVPN DNS servers then you need to configure a resolve script which will
automatically configure the
/etc/resolv.conffile with the IVPN DNS servers when connecting and remove them on disconnection. Install the script by installing the
openresolvpackage depending on the distro you are using. Most distributions will install the script in
/etc/openvpn/update-resolv-conf. If you cannot install the package then you can use a generic script such as the one on the arch wiki. Once this script is in place edit the
.ovpnfile from step 2 and add the lines below:
script-security 2 up /etc/openvpn/update-resolv-conf down /etc/openvpn/update-resolv-conf
- Start the OpenVPN service. If you did not follow step 5 then you will be prompted to enter your
sudo service openvpn start
- To check that the OpenVPN tunnel has started you can see if a
tundevice has been created (normally tun0) by looking at the output of
- Check your external IP to verify that you are connected.
- Most issues can be easily resolved by reviewing the logs. Some distributions will write OpenVPN logs
the syslog e.g.
/var/log/messages. If you cannot see OpenVPN log entries in syslog, add a new directive to the
.ovpnfile to enable file logging.
- To view the logs use grep to filter them from the log.
sudo grep VPN /var/log/syslog
Was this answer helpful?