Virtual Private Network (VPN) adalah solusi koneksi private melalui jaringan publik. Dengan VPN maka kita dapat membuat jaringan di dalam jaringan atau biasa disebut tunnel. Solusi VPN ada beberapa macam. Antara lain:
- IPSEC, solusi VPN via IP Secure Protocol. Solusi yang sudah distandarisasi tapi paling susah dikonfigurasi. Tingkat keamanan yang cukup baik namun dalam implementasinya cukup rumit. Aplikasi yang digunakan yang berbasis open source yaitu Open/Free Swan.
- PPPT, solusi VPN versi awal. Merupakan solusi VPN dengan feature standar dimana jaringan dibangun dengan point to point seperti halnya anda melakukan dial up pada internet dirumah. Pada saat dial up ke provider internet ada maka akan dibangun point to point tunnel melalui jaringan telepon. Aplikasi OpenSource yang menggunakan PPPT adalah PopTop.
- VPN with SSL, merupakan solusi VPN dengan menerapkan protocol Secure Socket Layer(SSL) pada enkripsi jaringan tunnel yang dibuat. Solusi ini diawali dengan aplikasi OpenVPN. Selain gratis karena open source juga memiliki kemudahan implementasi. Saya lebih memilih menggunakan OpenVPN karena kemudahan implementasinya serta bersifat multiplatform dapat dijalankan pada Linux ataupun Windows.
Kali ini saya coba menginstal VPN pada jaringan LAN sederhana dengan menggunakan OpenVPN dan dengan OS Centos 5.

VPN Server :
OS : CentOS Linux V5.3/kernel 2.6.18-128.EL5
Real IP : 192.168.48.200
VPN IP : 10.8.0.1
VPN Client :
OS : Windows XP
Real IP : 192.168.48.1
VPN IP : 10.8.0.x (server assigned)
==============
VPN Server
==============
1. Download paket-paket yang diperlukan.
#wget http://openvpn.net/release/openvpn-2.0.9.tar.gz #wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm #ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/lzo-devel-2.02-3.el5.kb.i386.rpm #ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/lzo-2.02-3.el5.kb.i386.rpm
2. Install dan build file download.
Sebelum memulai instalasi sebaiknya Anda menginstal repository berikut ini.
#yum install rpm-build #yum install autoconf.noarch #yum install zlib-devel #yum install pam-devel #yum install openssl-devel
Bila dependencies diatas telah terinstall, ikutilah langkah berikut ini untuk memulai instalasi:
#rpm -ivh lzo-2.02-3.el5.kb.i386.rpm #rpm -ivh lzo-devel-2.02-3.el5.kb.i386.rpm #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 contoh file konfigurasi berikut. Hal ini untuk mempercepat proses konfigurasi OpenVPN
#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. Konfigurasi Certificate Authority (CA)
#cd /etc/openvpn/easy-rsa/ #vi vars export KEY_COUNTRY=ID export KEY_PROVINCE=Sulteng export KEY_CITY=Palu export KEY_ORG="VPNTKJ" export KEY_EMAIL="my@vpn.mail" #. ./vars #./clean-all
5. Build root Certificate Authority (CA)
#./build-ca ......++++++ 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) [ID]: State or Province Name (full name) [SULTENG]: Locality Name (eg, city) [PALU]: Organization Name (eg, company) [VPNTKJ]: Organizational Unit Name (eg, section) []:tkj Common Name (eg, your name or your server's hostname) []:VPN Email Address [my@vpn.mail]:
6. Build Server Key dan Server Certificate
#./build-key-server vpnsrv1 Generating a 1024 bit RSA private key .....++++++ ........................++++++ writing new private key to 'vpnsrv1.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) [ID]: State or Province Name (full name) [SULTENG]: Locality Name (eg, city) [PALU]: Organization Name (eg, company) [VPNTKJ]: Organizational Unit Name (eg, section) []:tkj Common Name (eg, your name or your server's hostname) []:VPN Email Address [my@vpn.mail]: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: 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:'ID' stateOrProvinceName :PRINTABLE:'SULTENG' localityName :PRINTABLE:'PALU' organizationName :PRINTABLE:'VPNTKJ' organizationalUnitName:PRINTABLE:'tkj' commonName :PRINTABLE:'VPN' emailAddress :IA5STRING:'my@vpn.mail' Certificate is to be certified until Jun 27 05:21:29 2017 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. Build parameter Diffie Hellman parameters
#./build-dh Generating DH parameters, 1024 bit long safe prime, generator 2 This is going to take a long time ..........
8. Copy file CA
#cp keys/ca.crt ../ #cp keys/dh1024.pem ../ #cp keys/vpnsrv1.key ../ #cp keys/vpnsrv1.crt ../
9. Konfigurasi server untuk OpenVPN
#cd ../ #vi server.conf dev tap ;dev tun ca ca.crt cert vpnsrv1.crt key vpnsrv1.key # This file should be kept secret
10. Startup service
#service openvpn restart #chkconfig openvpn on
==============
VPN Client
==============
1. Download dan install OpenVPN GUI untuk Windows
http://openvpn.se/files/install_packages/openvpn-2.0.9-gui-1.0.3-install.exe
2. Konfigurasi CA
cmd.exe
>cd “C:\\Program Files\OpenVPN\easy-rsa”
>init-config.bat
>edit vars.bat
set KEY_COUNTRY=ID
set KEY_PROVINCE=SULTENG
set KEY_CITY=PALU
set KEY_ORG=VPNTKJ
set KEY_EMAIL=my@vpn.mail
(PS. Above must be same as the server)
3. Klik dua kali vars.bat atau jalankan file batch ini melalui command-line seperti perintah di bawah ini.
>vars.bat
>clean-all.bat
4. Build CA client key dan client scr
>md keys
>build-ca
>build-key vpnclient
5. Copy file client csr ke server. Pastikan copy keys/vpnclient.csr dari client ke direktori /etc/openvpn/easy-rsa/keys pada server.
#cd /etc/openvpn/easy-rsa/ #./sign-req vpnclient Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows countryName :PRINTABLE:'ID' stateOrProvinceName :PRINTABLE:'SULTENG' localityName :PRINTABLE:'PALU' organizationName :PRINTABLE:'VPNTKJ' organizationalUnitName:PRINTABLE:'tkj' commonName :PRINTABLE:'vpnclient' emailAddress :IA5STRING:'my@vpn.mail' Certificate is to be certified until Jun 27 06:40:48 2017 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. Kembali pada client, install file CA (seperti vpnclient.crt dan ca.crt)
Copy file crt (vpnclient.crt)yang telah dibuat di server dan file ca.crt dari server ke direktori Program Files/OpenVPN/config pada client.
>cd ..\config
>copy ..\easy-rsa\keys\vpnclient.key .\
7. Konfigurasi client untuk OpenVPN
>copy ..\sample-config\client.ovpn .\
Right-Click the OpenVPN GUI icon in the bottom right-hand corner, select ‘Edit Config’
dev tap
;dev tun
dev-node VPN_Tap
remote 192.168.48.200 1194
ca ca.crt
cert vpnclient.crt
key vpnclient.key
ns-cert-type server
8. Konfigurasi network interface untuk OpenVPN
Pilih “Control Panel” > “Network Connection” > “TAP-Win32#(#)”
Ganti nama interface tersebut menjadi ‘VPN_Tap’
9. Startup connection pada client
Pada task-bar, pilih “OpenVPN GUI” > click kiri “Connect”
Sampai disini Anda dapat melakukan koneksi ke OpenVPN server melalui VPN client menggunakan UDP connection. Silahkan mencoba!
Popularity: 2% [?]











19 Comments For This Post
05 Mar 2010 1:51 pm
permisi
tutor ini jalannya cuman di CentOS saja yach :-?
05 Mar 2010 3:13 pm
Tutornya dapat diimplementasikan pada seluruh turunan Rethat.
05 Mar 2010 4:10 pm
Thankz neh atas infonya bro
08 Apr 2010 5:46 pm
emmm.. tutorialnya bermanfaat banget , jujur nieh saya masih gaptek ama vpn, tapi saya pengen benget bs tuh ama yang namanya vpn . bisa donk mas yustian sharing …
oke …
10 Apr 2010 12:23 am
caranya copi vpnclient.csr dari client ke direktori /etc/openvpn/easy-rsa/keys pada server. dan
10 Apr 2010 2:03 pm
thank boss tutorialnya
17 Apr 2010 10:00 pm
servernya gk bisa pake windows y kk ??
21 Apr 2010 3:31 pm
bro, mau tanya…..
openVPN ini pake TCP or UDP???
soalnya ditutorial yg saya baca lebih menyarankan pake udp.. nah itu bikin saya tambah bingung… kenapa harus udp??
kan kl g salah, lebih bagus pake TCP…
mohon bantuannya..
22 Apr 2010 6:12 am
Permisi saya mau nanya
setelah memasukan command
#rpmbuild –rebuild lzo-1.08-4.rf.src.rpm
lalu keluar tulisan
RPM build errors:
InstallSourcePackage at: psm.c:246: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
user dag does not exist – using root
group dag does not exist – using root
user dag does not exist – using root
group dag does not exist – using root
Bad exit status from /var/tmp/rpm-tmp.alCaIm (%build)
itu knp yah? padahal saya sudah mengikuti langkah2nya.Saya menggunakan fedora 10.
Lalu mencoba mengetik command
#rpm -Uvh /usr/src/redhat/RPMS/i386/lzo-*.rpm
dan keluar tulisan
error: File not found by glob: /usr/src/redhat/RPMS/i386/lzo-*.rpm
smua paket sudah diinstal n di download sesuai dengan yg tertulis di blog ini.
Mohon dijawab, terima kasih
22 Apr 2010 4:38 pm
wah susah juga ya..
06 Jun 2010 5:48 pm
untuk openvpn apakah bisa/menyediakan sistem autentikasi untuk client di lakukan melalui web browser+ssl?
thanks
24 Jun 2010 3:53 am
Rumit banget. nyobak blum pernah berhasil. dead!
Oh ya, ini comment form-nya pkek plugin ap ya? (maaf oot)
27 Jun 2010 2:23 pm
HeLp Me
Bisa BaNtu TuTorx VPN GaTeway Pake MikRoTik ??
17 Jul 2010 3:37 pm
bang ada file ini :
ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/lzo-devel-2.02-3.el5.kb.i386.rpm
ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/lzo-2.02-3.el5.kb.i386.rpm
kalo ada tolong kasi link nya dong, atau dikirim ke mail saya (yuyu_report@yahoo.com or yuchana.zz@gmail.com), soalnya link yang ini dah ga bisa di access
20 Jul 2010 4:16 am
bro punya 2 applikasi ini gak :
#ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/lzo-devel-2.02-3.el5.kb.i386.rpm
.#ftp://ftp.pbone.net/mirror/centos.karan.org/el5/extras/testing/i386/RPMS/lzo-2.02-3.el5.kb.i386.rpm
28 Jul 2010 6:20 pm
mau tanya nieh , kenapa client selalu dapet ip yang sama ?
22 Nov 2010 1:31 pm
om klo tunnel vpn buat mobinity, paket2 apa aja yg musti d instal dan cr konfigurasinya bagaimana ? sy msh bingung untuk tunnel ini karna ada versi “stunnul” dan “ptunnel”, nah..yg mana yg musti di instal, mohon penjelasannya
makasih om
03 Apr 2011 9:36 pm
maaf saya mau tanya saya masuk kedalam directory ini kok ga adayah??
# rpm -Uvh /usr/src/redhat/RPMS/i386 openvpn-2.0.9-1.i386.rpm
trus ketika saya install rpm-build kok dy bilang…
public key for rpm-bulid.x.xxxxxxxx.rpm not be installed..
dan klo rpm-bulid blm keinstall koment #rpmbuild memang tidak ada yah??
mohon pencerahannya
22 Jun 2011 4:00 pm
sdah jalan belum waktu mencoba berhaisil gak…????
Leave a Reply