How to install OpenVPN Print

  • 54

How to install OpenVPN

OpenVPN is a free and open source software application that implements virtual private network (VPN) solutions for creating secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities.

To install via our bash script(Centos 5)

yum install wget -y

wget http://whattheserver.me/openvpninstaller-centos.sh

sh openvpninstaller-centos.sh


To manually do it use the below

Here are the steps to guide you installed OpenVPN.

1.Download the required package files.

# wget http://openvpn.net/release/openvpn-2.0.9.tar.gz

# wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm

2.Install and build your download files

You may need the required repository before start your installation

# yum install rpm-build

# yum install autoconf.noarch

# yum install zlib-devel

# yum install pam-devel

# yum install openssl-devel

If you have the above dependencies installed, you can start your installation as follows:

# rpmbuild –rebuild lzo-1.08-4.rf.src.rpm

# rpm -Uvh /usr/src/redhat/RPMS/i386/lzo-*.rpm

# rpmbuild -tb openvpn-2.0.9.tar.gz

# rpm -Uvh /usr/src/redhat/RPMS/i386/openvpn-2.0.9-1.i386.rpm

3. Copy configuration files

# cp -r /usr/share/doc/openvpn-2.0.9/easy-rsa/ /etc/openvpn/

# cp /usr/share/doc/openvpn-2.0.9/sample-config-files/server.conf /etc/openvpn/

4. CA configuration

# cd /etc/openvpn/easy-rsa/

# vi vars

then scroll down to the bottom, edit as you like.

export KEY_COUNTRY=AU

export KEY_PROVINCE=VIC

export KEY_CITY=MELBOURNE

export KEY_ORG=”THROXVPN”

export KEY_EMAIL=”name@email.com”

#./vars (note a space between . . )

#./clean-all

5. Build CA

#./build-ca

You are about to be asked to enter information that will be incorporated

into your certificate request.

6. Building Diffie Hellman

#./build-dh

Generating DH parameters, 1024 bit long safe prime, generator 2

This is going to take a long time

7. Copy key certificates to the required folder

#cp keys/ca.crt ../

#cp keys/dh1024.pem ../

#cp keys/ovpnsrv1.key ../

#cp keys/ovpnsrv1.crt ../

8. OpenVPN configuration

#cd ../

#vi server.conf

dev tap

;dev tun

ca ca.crt

cert ovpnsrv1.crt

key ovpnsrv1.key # This file should be kept secret

10. Startup the OpenVPN service

# service openvpn restart

# chkconfig openvpn on


Was this answer helpful?

« Back