Install OpenVPN Client on Ubuntu
Some users are interested in creating a private virtual network between the two computers. Provided by the task by using VPN technology (Virtual Private Network). Implemented the connection via public or private utilities and programs. After successful installation and configuration of all components of the procedure can be considered completed, and the connection is protected. Next, we would like to discuss in detail the implementation of the technology using OpenVPN client in an operating system based on Linux kernel.
Install OpenVPN on Linux
Since most of the users use based distributions Ubuntu, today’s instructions will be based on these versions. In other cases a fundamental difference in the installation and configuration of OpenVPN, you won’t notice unless I have the syntax of a distribution, what you can read in the official documentation of their system. We offer you to get acquainted with the entire process step by step, to better understand each activity.
One should take into account that the functioning of OpenVPN takes place via two host (computer or server), which means that installation and configuration applies to all members of the connection. Our next guide will focus just on two sources.
Step 1: Install OpenVPN
Of course, you should start with adding all required libraries to computers. Be ready, for the task used to be solely built-in OS “Terminal”.




Proceed to the next step only when the installation will be performed on both devices.
Step 2: create and configure a certification authority
Center specifications responsible for verifying public keys and provides strong encryption. It is created on the device, which then will connect to other users, so open a console on the desired PC and follow these steps:



sudo-i
# source ./vars
# ./clean-all
# ./build-ca

While the server computer can be left alone and to travel to client devices.
Step 3: configure the client certificates
The user manual with which you will be introduced below, you will need to spend on each client computer to organize properly functioning secure connection.



sudo-i
# source ./vars
# build-req Lumpics

Lumpics in this case, the specified file name. Created key must be in the same directory with the rest of the keys.


This is all preliminary work completed, it remains only to bring himself up OpenVPN in a normal condition and you can begin to use a private encrypted connection with one or more clients.
Step 4: Configuring OpenVPN
The following guide will address and the client part and the server. We will all share in the action and warn about changes to the machines so you just need to follow these instructions.



port 1194
proto udp
comp-lzo
dev tun
ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
cert /etc/openvpn/easy-rsa/2.0/keys/ca.crt
dh /etc/openvpn/easy-rsa/2.0/keys/dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
After you have completed all changes, save the settings and close the file.



client
dev tun
proto udp
remote 194.67.215.125 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/Sergiy.crt
key /etc/openvpn/easy-rsa/keys/Sergiy.key
tls-auth ta.key 1
comp-lzo
verb 3.
After editing is complete, launch OpenVPN: openvpn /etc/openvpn/client.conf.

For traffic forwarding and open Internet access for all clients on a server PC, you will need to alternately activate the following commands.
sysctl -w net.ipv4.ip_forward=1
iptables -A INPUT -p udp –dport 1194 -j ACCEPT
iptables-I FORWARD -i tun0 -o eth0 -j ACCEPT
iptables-I FORWARD-i eth0 -o tun0 -j ACCEPT
iptables-t nat -A POSTROUTING -o eth0 -j MASQUERADE
In today’s article, you were introduced to the procedure to install and configure OpenVPN on server and client side. I advise to pay attention on the notification shown in the”Terminal” and examine the error codes if they appear. Such actions will help to avoid further problems with the connection, because the prompt resolution of problems prevents other problems arising.