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% [?]














3 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
Leave a Reply