Installing OpenVPN on Linux
Written by pnyet   
Many people found that installing VPN on linux is not that easy, the abvailable installation guides on VPN is often limited. I have tried a lot of installation guides and finally get it connected successfully.

Here are the steps to guide you installed a secure connection between your CentOS5 and Windows with OpenVPN open source application.

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/
#pico vars (or use vi editor, I just like to use pico)

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=” This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
#.� ./vars (note a space between . . )
#./clean-all

5. Build CA

#./build-ca
Generating a 1024 bit RSA private key
………………………++++++
…………………….++++++
writing new private key to ‘ca.key’
—–
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:
State or Province Name (full name) [VIC]:
Locality Name (eg, city) [MELBOURNE]:
Organization Name (eg, company) [THROXVPN]:
Organizational Unit Name (eg, section) []:Throx
Common Name (eg, your name or your server’s hostname) []:throx.net
Email Address [ This e-mail address is being protected from spam bots, you need JavaScript enabled to view it ]:

Some information above already entered in step 4, hust hit enter and go to next line.

6. Building server key

#./build-key-server ovpnsrv1
Generating a 1024 bit RSA private key
………………………………….++++++
…………………….++++++
writing new private key to ‘ovpnsrv1.key’
—–
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter ‘.’, the field will be left blank.
—–
Country Name (2 letter code) [AU]:
State or Province Name (full name) [VIC]:
Locality Name (eg, city) [MELBOURNE]:
Organization Name (eg, company) [THROXVPN]:
Organizational Unit Name (eg, section) []:Throx
Common Name (eg, your name or your server’s hostname) []:throx.net
Email Address [ This e-mail address is being protected from spam bots, you need JavaScript enabled to view it ]:
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:<enter your password here>
An optional company name []:
Using configuration from /etc/openvpn/easy-rsa/openssl.cnf
Check that the request matches the signature
Signature ok
The Subject’s Distinguished Name is as follows
countryName :PRINTABLE:’AU’
stateOrProvinceName :PRINTABLE:’VIC’
localityName :PRINTABLE:’MELBOURNE’
organizationName :PRINTABLE:’THROXVPN’
organizationalUnitName:PRINTABLE:’Throx’
commonName :PRINTABLE:’throx.net’
emailAddress :IA5STRING:’ This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
Certificate is to be certified until Apr 10 15:15:27 2018 GMT (3650 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

7. Building Diffie Hellman

#./build-dh
Generating DH parameters, 1024 bit long safe prime, generator 2
This is going to take a long time

(Wait until it finished)

8. Copy key certificates to the required folder

#cp keys/ca.crt ../
#cp keys/dh1024.pem ../
#cp keys/ovpnsrv1.key ../
#cp keys/ovpnsrv1.crt ../

9. OpenVPN configuration

#cd ../
#pico 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 (Finally, hold your breath)

#service openvpn restart
#chkconfig openvpn on

Windows Client Installation and Configuration

1. Download a copy of windows client

http://openvpn.net/release/openvpn-2.0.9-install.exe and install it.

2. Create CA in windows machine

Open windows cmd.exe command promp and change directory (cd) into c:\program files\openvpn\

>copy vars.bat.sample vars.bat
>edit vars.bat (scroll down to the bottom)
set KEY_COUNTRY=AU
set KEY_PROVINCE=VIC
set KEY_CITY=MELBOURNE
set KEY_ORG=THROXVPN
set KEY_EMAIL= This e-mail address is being protected from spam bots, you need JavaScript enabled to view it

note: the above information must be same as the details set in server previously.

3. Run the file vars.bat

>vars

4. Build client’s key and certificate

>copy openssl.cnf.sample openssl.cnf
>md keys
>build-key vpnhome

5. Copy vpnhome.csr to the server directory /etc/openvpn/easy-rsa/keys

#cd /etc/openvpn/easy-rsa/
#./sign-req vpnhome
Using configuration from /etc/openvpn/easy-rsa/openssl.cnf
Check that the request matches the signature
Signature ok
The Subject’s Distinguished Name is as follows
countryName :PRINTABLE:’AU’
stateOrProvinceName:PRINTABLE:’VIC’
localityName :PRINTABLE:’MELBOURNE’
organizationName :PRINTABLE:’THROXVPN’
organizationalUnitName:PRINTABLE:’Throx’
commonName :PRINTABLE:’throx.net’
emailAddress :IA5STRING:’ This e-mail address is being protected from spam bots, you need JavaScript enabled to view it
Certificate is to be certified until Apr 10 16:04:33 2018 GMT (3650 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated

6. Copy new signed certificate to your windows machine

Go to /etc/openvpn/easy-rsa/keys/ , you will see 2 new generated file - ca.crt and vpnhome.crt

Copy both of them to your Windows home machine c:/Program Files/OpenVPN/config

Also copy your windows generated vpnhome.key from C:\Program Files\OpenVPN\easy-rsa\keys to C:\Program Files\OpenVPN\config

7. Setting the client configuration for OpenVPN

Copy client.ovpn from C:\Program Files\OpenVPN\sample-config to C:\Program Files\OpenVPN\config

Edit it with the followings changes, similar to what you have done in the linux server

dev tap
;dev tun
dev-node OpenVPN_Tap
remote <ipaddress> 1194 (example: remote 202.188.1.1 1194)
ca ca.crt
cert alanghome.crt
key alanghome.key
ns-cert-type server

8. Configure the network interface for OpenVPN
Select “Control Panel” -> “Network Connection” -> “TAP-Win32#(#)”
Right-Click to rename as ‘OpenVPN_Tap’

9. Startup the connection of client

Go to START>All Programs>OpenVPN>OpenVPN GUI , click it

In the task-bar, select “OpenVPN GUI” -> right-click “Connect”

Phew…. if everything set correctly, now you should be connected to your linux via OpenVPN.

Source: http://yumax1012.blogspot.com


+/-
Write comment
Name:
Email:
 
Title:
 
:):grin;)8):p:roll:eek:upset:zzz:sigh:?:cry
:(:x
 
Please input the anti-spam code that you can read in the image.
+/- Comments
Add New Search RSS
Melwin  - CoPas Molo =))   |202.158.70.xxx |22-01-2009 11:08:28
Ketahuan lo copas molo, bljar lah bhs inggris supaya cepet bisa dan makin yahud
.... hiHIihihihi
pnyet  - hiks hiks hiks....   |202.47.75.xxx |22-01-2009 11:20:05
Siyap...., blogging lagi dong mas...
Ini juga sambil belajar aiueo ala
inggris.
Beh, tambah gendut no?
Anonymous   |222.174.116.xxx |10-06-2010 13:08:11
Do you want to become more charming and attractive?Wearing our beautiful link:http://www.unshoessales.com/ Shoes with a charming link:http://www.unshoessales.com/herve-leger-c-35 .html,you will become
the focus that numerous people fixes eyes upon.If you feel that it is
not gorgeous enough,please select our link:http://www.unshoessales.com/jimmy-choo-shoes -c-49.html and link:http://www.unshoessales.com/manolo-blahnik-s hoes-c-48.html which can
make your feet more attractive.However,If you choose link:http://www.shoeseasybuy.com/ Which have the ability to make you seem
higher, link:http://www.unbootssale.com/ which are endlessly comfortable and
watching link...
zaa   |110.184.123.xxx |11-06-2010 08:46:22
The link:http://www.oakleysunglassessale.com impact link:http://www.oakleysunglassessale.com of link:http://www.oakleysunglassessale.com narrower link:http://www.oakleysunglassessale.com budget link:http://www.oakleysunglassessale.com gaps link:http://www.oakleysunglassessale.com
zaa   |110.184.123.xxx |11-06-2010 08:55:03
The link:http://www.oakleysunglassessale.com impact link:http://www.oakleysunglassessale.com of link:http://www.oakleysunglassessale.com narrower link:http://www.oakleysunglassessale.com budget link:http://www.oakleysunglassessale.com gaps link:http://www.oakleysunglassessale.com
Anonymous   |110.184.123.xxx |11-06-2010 08:57:46
million link:http://www.raybansunglassesonsale.com. Mr link:http://www.raybansunglassesonsale.com . Hsieh link:http://www.raybansunglassesonsale.com/ray-ba n-3025-sunglasses-45.htm
l came link:http://www.raybansunglassesonsale.comaway link:http://www.raybansunglassesonsale.com with link:http://www.raybansunglassesonsale.com$40 link:http://www.raybansunglassesonsale.com million link:http://www.brandbagsshop.com
Anonymous   |110.184.123.xxx |11-06-2010 08:58:34
The link:http://www.raybansunglassesale.comFinancial link:http://www.raybansunglassesale.com Crisis link:http://www.raybansunglassesale.com Inquiry link:http://www.raybansunglassesale.comCommission  link:http://www.raybansunglassesale.comissued link:http://www.raybansunglassesale.coma link:http://www.mlbjerseysale.comsubpoena link:http://www.mlbjerseysale.com to link:http://www.mlbjerseysale.com Goldman link:http://www.mlbjerseysale.com demanding link:http://www.mlbjerseysale.comthat link:http://www.mlbjerseysale.comthe link:http://www.mlbjerseysale.comfirm link:http://www.ghdhairshop.com/ghd-purple-p-184. htmlprovide link:http://www.ghdhairshop.com/ghd-purple-p-184. html a link:http://www.ghdhairshop.com/ghd-purp...
Anonymous   |110.184.123.xxx |11-06-2010 08:59:20
The link:http://www.guccisunglassessale.comrecall, link:http://www.guccisunglassessale.com reported link:http://www.guccisunglassessale.com earlier link:http://www.guccisunglassessale.com by link:http://www.guccisunglassessale.comthe link:http://www.guccisunglassessale.com Los link:http://www.guccisunglassessale.com Angeles link:http://www.guccisunglassessale.comTimes, link:http://www.pradabagsale.com/miu-miu-handbags -s-11_11.html may link:http://www.pradabagsale.com/miu-miu-totes-s- 10_10.html do link:http://www.pradabagsale.com/miu-miu-s-9.html some link:http://www.pradabagsale.com/prada-hobos-s-6_ 6.html damage link:http://www.pradabagsale.com/prada-clutches-s -7_7.html to link:http://www.pradabagsale.co...
zero   |118.116.99.xxx |25-06-2010 14:19:31
Three link:http://www.tbcgold.com passions, link:http://www.gamelee.com simple link:http://www.wowgold.ws but link:http://www.tbcgold.com overwhelmingly link:http://www.tbcgold.com strong, have link:http://www.tbcgold.com governed link:http://www.tbcgold.com my link:http://www.tbcgold.com life: the link:http://www.tbcgold.com longing link:http://www.gamelee.com for link:http://www.gamelee.com love, the link:http://www.gamelee.com search link:http://www.gamelee.com for link:http://www.gamelee.com knowledge, and link:http://www.wowgold.ws unbearable pity link:http://www.wowgold.ws for the link:http://www.wowgold.ws suffering of link:http://www.wowgold.ws mankind. These link:http://www.wowgold.ws passions...
zero   |118.116.99.xxx |25-06-2010 14:22:49
All over link:http://www.tbcgold.com/buy-World-of-Warcraft -USA-power-leveling-2.ht
ml my garden link:http://www.tbcgold.com/buy-World-of-Warcraft -USA-power-leveling-2.ht
ml I
yuyangguoji  - lw   |222.174.116.xxx |20-07-2010 12:02:40
I firmly believe you need the link:http://www.undvdsale.com/actionadventure-dvd -c-38.html with
reasonable price that with the high quality,and we will let your dream
come true,a bloody cool boy is born with our link:http://www.unbootssale.com/ in the crowd.So don't hesitate,just come
to our online shop to catch the opportunity once in the blue
moon,to pick up and buy our link:http://www.undvdsale.com/p90x-workout-dvd-c- 52.html,a wide range
from link:http://www.unbootssale.com/, link:http://www.unbootssale.com/MBT-Sport-Shoes.h tml and link:http://www.unbootssale.com/ to link:http://www.undvdsale.com/p90x-workout-dvd-c- 59.html.Of course we are
sure you wil...
babydoll   |120.36.36.xxx |20-07-2010 13:21:36
Now lots of people buy adult *** product to improve *** life link:http://www.daily***nlove.com/,we supply all kinds of adult ***
product link:http://www.daily***nlove.com/,because we are manufacture and have our
factory link:http://www.daily***nlove.com/,our product are all safe and wholesale link:http://www.daily***nlove.com/,welcome to visit our store link:http://www.daily***nlove.com/,all kinds of adult *** product for
female and male link:http://www.daily***nlove.com/, you will buy your love *** product
from our store link:http://www.daily***nlove.com/,adult *** product will greatly improve
the quality of your *** life link:http://www.daily***nlove.com/,***...
Muslim Items   |61.154.6.xxx |29-07-2010 16:12:42
298274818336917502974 From the official link:http://www.onlinemuslimitems.com/ website of anticipated link:http://www.onlinemuslimitems.com/ Star Wars The link:http://www.onlinemuslimitems.com/ Old Republic comes link:http://www.onlinemuslimitems.com/ this new video where the link:http://www.onlinemuslimitems.com/ game designers link:http://www.onlinemuslimitems.com/ tell us a little about link:http://www.onlinemuslimitems.com/ the 2 different link:http://www.onlinemuslimitems.com/ classes find Sith characters link:http://www.onlinemuslimitems.com/ in the game, The link:http://www.findnike.com Inquisitor Sith link:http://www.onlinemuslimitems.com and Sith Warrior. They explain ...
Anonymous   |110.185.21.xxx |30-07-2010 15:07:22
link:http://www.discountu99boots.com/
link:http://www.edhardyshirtsclub.com/
wansantg1h f
link:http://www.hijordan.us/
link:http://louis-vuitton-replica-handbags.com/
link:http://www.mydiscountjordanshoes.com/
link:http://www.nfljerseysshopping.com/
link:http://www.p90xworkoutscheduledvd.com
katharine  - soul of business   |123.158.164.xxx |04-08-2010 13:38:39
published on the Airman by subject matter expert link:http://www.watchesfaner.com/breitling-watche s.html cheap and
cheerful has stood the test of time and link:http://www.corwatches.org/tag_heuer-watches. html first Mickey Mouse
clock ever in 1933 Timex link:http://www.corwatches.org/cartier-tank_ameri caine-watches.html
replica tudor watches parts Take this notethose parts were link:http://www.corwatches.org/rolex-watches.html omegamania watches
transformation of a wrist watches from the device link:http://www.watchesfaner.com/rolex-watches.ht ml the Motel 6 hotel
chains newly redesigned rooms  link:http://www.sanwatches.com/ been active in the field of hor...
decla  - tan kwai fragrance   |123.153.72.xxx |28-08-2010 07:11:47
championship famous for its really special link:http://www.watchesbin.com/panerai-watches.ht ml collection With more
than 25 years in the link:http://www.watchesdoc.com/ladies_watches.htm l complex looking 44mm
wide case will come in at link:http://www.watchesbin.com/panerai-classic-wa tches.html air king
watches proud as it is from IWC which is a world known link:http://www.everywatches.com/bvlgari-watches. html deville watches
watches what I really like is to design time link:http://www.watchesbin.com/rolex-watches.html range in an environment
which perfectly bridges link:http://www.watchesdoc.com/ you find dials movements or glass gets
worn link:http://www.wa...
ugg boots   |221.0.76.xxx |24-09-2010 13:03:06
UGG boots snow link:http://www.buycheapugg.co.uk/shoe/ugg-classi c-tall-5815-black, link:http://www.buycheapugg.co.uk/shoe/ugg-classi c-tall-5815-sand , link:http://www.buycheapugg.co.uk/shoe/ugg-classi c-tall-5815-chestnut, link:http://www.buycheapugg.co.uk/shoe/ugg-classi c-tall-5815-chocolate, link:http://www.buycheapugg.co.uk/shoe/ugg-classi c-tall-5815-grey, link:http://www.buycheapugg.co.uk/shoe/ugg-classi c-short-5825-black, link:http://www.buycheapugg.co.uk/shoe/ugg-classi c-short-5825-sand, link:http://www.buycheapugg.co.uk/shoe/ugg-classi c-short-5825-chestnut
this yea link:http://www.buycheapugg.co.uk/shoe/ugg-classi c-short-5825-chocolate, link:http://www.buycheapugg.co.uk/sho...
yaobingjian  - links of london   |123.165.110.xxx |02-12-2010 12:42:58
there are the flower, and link:http://www.linkslondon.uk.com leaf wandering  link:http://www.linkslondon.uk.com in the cool night early links of London
sweetie, lonely link:http://www.linkslondon.uk.com in the moonlight.Any thoughts of the link:http://www.linkslondon.uk.com water are in the night. At night, there
link:http://www.linkslondon.uk.com is the only static link:http://www.linkslondon.uk.com breath. Those in the bottom line of
sadness link:http://www.linkslondon.uk.com/sweetie-bracel ets began. Look,
weibao  - vibram   |123.165.110.xxx |02-12-2010 12:47:00
youth years, a vow link:http://www.vibram.us.com/ to earth, a review will be out of time.Is
like link:http://www.vibram.us.com/ enthusiasm, this is a moth of love, is link:http://www.vibram.us.com/ this really longing for love, link:http://www.vibram.us.com/ to look back, vibram i found tears
cheap coach handbags  - cheap coach handbags   |121.205.213.xxx |11-05-2011 22:28:42
link:http://www.coach-handbags.org link:http://www.supernfljerseys.com link:http://www.cheapjordansneaker.org link:http://www.supernfljerseys.com link:http://www.coach-handbags.org link:http://www.brand-sports.com link:http://www.brand-sports.com link:http://www.brand-sports.com link:http://www.brand-sports.com link:http://www.supernfljerseys.com link:http://www.cheapjordansneaker.org link:http://www.cheapjordansneaker.org link:http://www.brand-sports.com link:http://www.cheapjordansneaker.org link:http://www.cheapjordansneaker.org link:http://www.cheapjordansneaker.org link:http://www.brand-sports.com link:http://www.brand-sports.com link:http://www.brand-sports.com link:http://www.brand-sports.com link:http://www.b...
Andy   |175.42.32.xxx |20-08-2011 15:41:21
link:http://www.fake-watches-replica.com/audemars -piguet-c-1.htmlcan
provide the close look and character that the true matter could only at
a practically lower price. There are a lot of accompanies that
provide top character link:http://www.fake-watches-replica.com/audemars -piguet-audemars-piguet-
classique-collection-watch es-c-1_3.htmlwhich could make a content on
your heart. This watch that you are able to like is link:http://www.fake-watches-replica.com/audemars -piguet-audemars-piguet-
contemporaine-collection-w atches-c-1_4.htmlbrand. You are able to
discover well-favoured link:http://www.fake-watches-replica.com/audemars -piguet-audem...
diana  - dangerous thing   |123.153.65.xxx |25-08-2011 08:58:30
franck muller watches link:http://www.stilwatches.com/cartier-watches.h tml watches cartier link:http://www.watchesbasic.org/omega-watches.ht ml replica omega panerai
watches link:http://www.watchestype.net/rolex-watches.htm l replica rolex tank
solo watches hometowns link:http://www.watchestype.net/tag_heuer-watches .html watches tag heuer
longines watches link:http://www.keepwatches.org/ autumn wind whistle profes link:http://www.watchescode.org/breitling-watches .html replica breitling
watches.
miglia  - pasha watches   |123.153.65.xxx |25-08-2011 13:28:39
hublot watches link:http://www.watchesdoc.org/cartier-watches.ht ml cartier replica link:http://www.tricwatches.com/omega-watches.htm l fake omega watches
panerai watches link:http://www.watchesfaner.org/rolex-watches.ht ml replica rolex watches
for sale oris watches phone link:http://www.watchesun.net/tag_heuer-watches.h tml replica tag heuer
williamsf team watches link:http://www.watchesun.net/ longines watches datejust link:http://www.watchesairs.com/breitling-watches .html watches breitling.
Coach Outlet Online  - Coach Outlet Online   |121.158.55.xxx |16-11-2011 13:26:57
One link:http://www.coachsfactoryoutlet.org/ of clothing

link:http://www.coachfactorysoutletstoreonline.ne t/ be loose

link:http://www.coachfactorystore-online.com/ compliment the

link:http://www.coachoutletstoreonline.ca/ of
the [url=http://www.coachsfactory-

online.net/]Coach Factory[/url]. A
loose link:http://www.coachfactorysoutletstoreonline.ne t/ or a skirt link:http://www.coachsfactoryoutlet-online.net/ help the

link:http://www.coachfactoryoutletonlineh.com/ Bags flow

link:http://www.mycoachfactorystoreonline.org/ what you

link:http://www.coachoutletstoreonlineh.com/ wearing. Small

link:http://www.coachfactorystore-online.com/ with a

link:...

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."