INSTALL OPENVPN CENTOS 5.32 BIT

Sebagaimana yang sudah saya jelaskan tentang openVPN DISINI
Kali ini saya ingin berbagi , bagaimana cara Instal OpenVPN,
Khusus nya pada CENTOS 5 VERSI 32 BIT.


Alat Yang di butuhkan :
  1.  Server VPS / VPS server CENTOS 5 . 32 bit
  2. Putty bisa anda download DISINI Atau bisa Menggunakan bitvise Tunneler bisa kamu download DISINI

Ok kita langsung mulai saja ya

  • buka Putty / bitvise Tunneler, Masukkan IP Server ke Putty / bitvise lalu lanjutkan dengan menghubungkan nya ke server.
Copy dan paste script di bawah ini satu persatu.
Cek Status tun / tap
cat /dev/net/tun

Cek Operasional System.
cat /etc/redhat-release



Cek Versi 32 bit atau 64 Bit
uname -i




OK kita mulai menginstal. Copy lalu paste kode di bawah ini ke terminal bitvise atau Putty satu demi satu.


yum install zlib zlib-devel pam pam-devel openssl openssl-devel gcc patch gcc rpm-build autoconf.noarch zlib-devel pam-devel openssl-devel make -y
wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm && wget http://openvpn.net/release/openvpn-2.1.1.tar.gz && rpmbuild --rebuild lzo-1.08-4.rf.src.rpm
rpm -Uvh /usr/src/redhat/RPMS/i386/lzo-*.rpm
rpmbuild --define='with_pkcs11=""' -ta openvpn-2.1.1.tar.gz && rpm -Uvh /usr/src/redhat/RPMS/i386/openvpn-2.1.1-1.i386.rpm
cp -r /usr/share/doc/openvpn-2.1.1/easy-rsa/ /etc/openvpn/
cd /etc/openvpn/easy-rsa/2.0
uname -i
source ./vars
./vars
./clean-all
./build-ca
./build-key-server server
./build-dh
cp /etc/openvpn/easy-rsa/2.0/keys /etc/openvpn/keys -R
cd /etc/openvpn


Sampai Step ini, Kita lanjutkan Membuka Port. Disini kita asumsikan kita akan membuka Port TCP 443



vi 443.conf

Lanjutkan Dengan menekan tombol I untuk input script. lalu copy dan paste kode di bawah ini sekaligus ke dalam terminal
Kita asumsikan disini IP VPS nya 111.111.111.111 sesuaikan/ganti IP tersebut dengan IP VPS agan ya.


local 111.111.111.111 port 443
proto tcp
dev tun
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key
dh /etc/openvpn/keys/dh1024.pem
plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login
client-cert-not-required
username-as-common-name
server 10.10.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "route-method exe"
push "route-delay 2"
keepalive 5 30
cipher AES-128-CBC
comp-lzo
persist-key
persist-tun
status server-vpn.log
verb 3
push route 10.1.89.130 255.255.255.255 net_gateway
push route 10.19.19.19 255.255.255.255 net_gateway
push route 10.0.4.38 255.255.255.255 net_gateway
push route 202.152.240.50 255.255.255.255 net_gateway
push route 10.17.27.250 255.255.255.255 net_gateway
push route 0.0.0.0 0.0.0.0
management 111.111.111.111 101

Setelah selesai, Tekan tombol ESC lalu ketik perintah  :wq dan tekan Enter

selanjutnya restart openvpn.


service openvpn restart
cek config vpn
chkconfig openvpn on
lanjutkan mengubah value dari 0 menjad 1
nano /etc/sysctl.conf


Perhatikan tulisan yang terdapat di sana :
find net.ipv4.ip_forward and give value =
ubah menjadi
find net.ipv4.ip_forward and give value =

catatan :  apabila ada pesan error pada saat menjalankan perintah nano. install dulu nano nya dengan comand
.yum install nano

Lanjut ke setingan iptables
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 10.11.0.0/24  -j SNAT --to 45.55.135.56
service iptables save
service iptables restart
chkconfig iptables on


Selesai, sekarang kita ambil sertificate server nya 
nano /etc/openvpn/keys/ca.crt

copy sertifikat tersebut dan paste ke notepad, lalu simpan dalam bentuk all file, beri nama ca.crt

selesai

Sekarang tinggal kita membuat config untuk client nya


client
proto tcp
 remote 111.111.111.111 443
persist-tun
dev tun
pull
comp-lzo
ns-cert-type server
verb 3 mute 2
mute-replay-warnings
auth-user-pass
 redirect-gateway def1
script-security 2
route-method exe
route-delay 2
cipher AES-128-CBC
ca ca.crt

Sign up here with your email address to receive updates from this blog in your inbox.

0 Response to "INSTALL OPENVPN CENTOS 5.32 BIT"

Post a Comment