Tutorial Centos How To install OpenVPN Centos

Tutorial How To install OpenVPN Centos 5 or Centos 6, before install openvpn on centos you must to know what is openvpn?
With OpenVPN, you can:

  • tunnel any IP subnetwork or virtual ethernet adapter over a single UDP or TCP port,
  • configure a scalable, load-balanced VPN server farm using one or more machines which can handle thousands of dynamic connections from incoming VPN clients,
  • use all of the encryption, authentication, and certification features of the OpenSSL library to protect your private network traffic as it transits the internet,
  • use any cipher, key size, or HMAC digest (for datagram integrity checking) supported by the OpenSSL library,
  • choose between static-key based conventional encryption or certificate-based public key encryption,
  • use static, pre-shared keys or TLS-based dynamic key exchange,
  • use real-time adaptive link compression and traffic-shaping to manage link bandwidth utilization,
  • tunnel networks whose public endpoints are dynamic such as DHCP or dial-in clients,
  • tunnel networks through connection-oriented stateful firewalls without having to use explicit firewall rules,
  • tunnel networks over NAT,
  • create secure ethernet bridges using virtual tap devices, and
  • control OpenVPN using a GUI on Windows or Mac OS X.
  • Read Documentation here http://openvpn.net/index.php/open-source/documentation.html

after you know function and how usefull openVPN you can starting and prepare installation on Centos Server, you can have centos 5 or centos 6. lets start install openvpn on centos.

first check are tun/tap enable or not with this command

and output :
crw------- 1 root root 10, 200 Jun 15 21:07 /dev/net/tun
if not enable you can request enable tun / tap to your vps provider, usually vps with openvz virtualization they disable tun/tap by default, to enable this you can request and ask to your provide vps

we need install package for openvpn install them :

now we needed download openvpn and lzo :
with this tutorial i have work perfect with openvpn version 2.0.9, but you can use latest version or you can upgrade latter. ok, now download openvpn and lzo

lets configure and build using RPM if you using centos 64-bit or centos 32bit:
to check version OS you have use command :

On Centos 64-bit

On Centos 32-bit

now copy file :

creating and build ca certified

if you read question you can skip just answer “Common Name”

we need build key server

build Diffie Hellman

now almost done tutorial install openvpn on centos, but we need build and manage all openvpn file to easy manage and create user etc.

copy all to /etc/openvpn/keys to make you easily manage your open VPN letter

go to directory /etc/openvpn/

before create config server, you may need backup first

edit server.conf, you need put it blank and write text dev tun

delete all text and put only text dev tun

now we need create config for server, example we need and use tcp on port 443

then write this :

see line with text server (remember this)

now see are your openvpn running work fine or not, use command

if not running fine, you can see from first and check again on config443.conf, or for first troubleshooting openvpn not work fine you can delete first config443.conf and restart again openvpn, if your script running lets do next step.

Enabling packet forwarding :

check again on your config remember line server now Edit NAT table for MASQUERADING (if you have XEN VPS or Dedicated Server) use command :

if you have vps you can use command :

configure client :
now download openvpn client to your windows system http://openvpn.se/files/install_packages/openvpn-2.0.9-gui-1.0.3-install.exe
download ca.crt in directory /etc/openvpn/keys/
create file and put in : c:\program files\openvpn\config
dev tun
proto tcp
remote 443
resolv-retry infinite
route-method exe
resolv-retry infinite
ca ca.crt
verb 3

last we needed create account :

create password

then restart openvpn

and connect to your openvpn and enjoy your vpn server, tutorial centos how easy install and configure openvpn on centos

i see many people ask why this is not work,, but if this not work for you, try this one install openvpn on centos 6.3

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *