Configuring OpenVPN Linux Client

We connect the EPEL repository from where we will install OpenVPN.

[[email protected] ~]# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

Install OpenVPN

[[email protected] ~]# yum -y install openvpn

Add OpenVPN to startup at computer startup

[[email protected] ~]# chkconfig openvpn on

Copy the OpenVPN client configuration file template to the / etc / openvpn / directory

[[email protected] ~]# cp /usr/share/doc/openvpn-2.1/sample-config-files/client.conf / etc / openvpn /

And we bring it to the following form:

clientdev tunproto tcpremote 194.28.85.220 1194resolv-retry infi niteuser nobodygroup nobodypersist-keypersist-tunca ca.crtcert pc1.crtkey pc1.keyns-cert-type serverlog-append /var/log/openvpn.logcomp-lzoverb 3

Now copy the files ca.crt, pc1.crt and pc1.key from the server to the / etc / openvpn / folder (these files are created on the OpenVPN server we are connecting to)

[[email protected] ~]# cd / etc / openvpn /[[email protected] ~]# scp [email protected]: /etc/openvpn/ca.crt ./[[email protected] ~]# scp [email protected]: /etc/openvpn/2.0/keys/pc1.key ./[[email protected] ~]# scp [email protected]: /etc/openvpn/2.0/keys/pc1.crt ./

Where 194.28.85.220 is the IP-address of the server. That’s all, the OpenVPN client configuration is complete. Launch OpenVPN:

[[email protected] ~]# service openvpn start

Sidebar