Senin, 09 Juni 2014

Cara Install Softether VPN di Debian 6-7 dan CentOS 6.x; NAT MODE (part II)


ini adalah tutor lanjutan dari cara install softether vpn di debian 7-7 dan centos 6.x; NAT MODE (part I) buat yng belum paham part I, jangan terlalu berharap bisa lanjut ke part II :p
dalam tutor ini, saya mencontohkan konfigurasi via windows, silahkan donlot vpn server untuk windos di http://www.softether-download.com/en.aspx
kurang lebih seperti ini
donlot dan install, tak perlu saya menjabarkannya kan???

stelah proses instalasi selsai, buka  SE-VPN Server Manager (Tools) nya.... pastikan saaat anda membuat profile, anda terkoneksi dengan internet (wajib)

okay... stelah suksek klik connect....

pilih manage virual hub, kemudian pilih virtual NAT and virtual DHCP server, kemudian klik enable secure nat

klik exit.

untuk menambah dan menghapus user silahkan pilih manage user, silahkan berimprovisasi sendiri...
done! tutor selesai.

note:
warning! saya tidak menyaraknan anda mengunakan fitur secureNat karena akan menyebabkan penggunaan resources CPU yg sangan tinggi dan akan memungkinkan server/VPS anda di baned. next tutor solusi jawaban alternatif selain secureNat. :D

Kamis, 05 Juni 2014

Cara Install Softether VPN di Debian 6-7 dan CentOS 6.x; NAT MODE (part I)

mumpung saya sendang pake cent os, kali ini saya akan mencoba menulis tentang cara install softethervpn di centos. silahkan cek dan pastikan platform OS yng anda gunakan dengan cara:

uname -a
perhatikan versinya, kalo hasilnya i686 maka os nya 32 bit, tapi kalo keterangannya x64 maka os nya 64 bit.
oke, skarang unduh softeter vpn servernya sesuai dengan platform os ente di http://www.softether-download.com/en.aspx
saya mencontohkan menggunakan os 32 bit, maka kurang lebih seperti ini...
klik kanan di no 5, trus copy link location, donlot menggunakan wget dan pastekan linknya, jadinya seperti ini, dan tunggu sampai proses download nya selesai.
wget http://www.softether-download.com/files/softether/v4.06-9437-beta-2014.04.09-tree/Linux/SoftEther%20VPN%20Server/32bit%20-%20Intel%20x86/softether-vpnserver-v4.06-9437-beta-2014.04.09-linux-x86-32bit.tar.gz
selanjutnya install pacakge yang diperlukan atau di syaratkan oleh softether....
centos
yum groupinstall "Development Tools"
yum install gcc 
yum install nano
debian
apt-get install build-essential
apt-get install nano
extrak sofeternya yang sudah di donlot dengan cara
 tar xzvf softether-vpnserver-v4.06-9437-beta-2014.04.09-linux-x86-32bit.tar.gz
masuk ke direktori sofeter dan compile dengan cara dengan cara
cd vpnserver
make
pilih 1-1-1 untuk melanjutkan.. saat proses compiling pastikan ada pesan "pass" untuk setiap kriteria yng di butuhkan.

setelah compiling sukses, pindah kan hasil copiling tadi ke /usr/local dengan cara
cd ..
mv vpnserver /usr/local
cd /usr/local/vpnserver/
beri permision seperti ini
chmod 600 *
chmod 700 vpnserver
chmod 700 vpncmd
buat config untuk menjalankan softether
nano /etc/init.d/vpnserver
paste kan code berikut

#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
touch $LOCK
;;
stop)
$DAEMON stop
rm $LOCK
;;
restart)
$DAEMON stop
sleep 3
$DAEMON start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit 0
save dengan cara ctrl+x confirm y, enter
next, buat folder /var/lock/subsys (jika belum ada)
centos
mkdir  /var/lock/subsys
set permiision pada startup filenya dengan cara
centos
chmod 755 /etc/init.d/vpnserver && /etc/init.d/vpnserver start
dan, agar bisa auto start saat boot,
centos
chkconfig --add vpnserver 
debian
chmod 755 /etc/init.d/vpnserver
mkdir /var/lock/subsys
update-rc.d vpnserver defaults
/etc/init.d/vpnserver start
cd /usr/local/vpnserver/
yooosh! tahap pertama selesai...
tahap  selanjutnya adalah konfigurasi user di softeter, silahkan masuk ke folder /usr/local/vpnserver dan jalankan perintah ./vpncmd dengan cara
cd /usr/local/vpnserver
./vpncmd
pilih 1
enter
enter
VPN Server>ServerPasswordSet
isi password nya dan exit.

oks! sampai disini proses installasi softeter di sisi server (VPS) sudah selesai....
karena tutor terlalu panjang, bersambung ke part II ya... heheee....

note:
usahakan menggunakan fresh install os, kalo tidak, silahkan tutup port 443,  992, 1194 dan 5555.

Rabu, 04 Juni 2014

How to Install OpenVPN server 2.3.2 on CentOs 6x


hahaha.... puas juga stelah nguwik-uwik openvpn 2.3.2 jadi juga....
langsung saja,  step pertama, cek dulu apakah server ready untuk vpn...
cat /dev/net/tun
pastikah hasilnya seperti ini
cat: /dev/net/tun: File descriptor in bad state
kedua, pastikan repository sudah terinstall dan sudah ter-update, jika belum silahkan baca cara menambahkan EPEL Repository pada cent OS 5.x dan 6.x
yossh! next step, masuk ke tahap installasi
yum install gcc make rpm-build autoconf.noarch zlib-devel pam-devel openssl-devel nano openvpn easy-rsa -y
easy-rsa skirp ada di /usr/share/easy-rsa/, buat folder /easy-rsa/keys di dalam folder /etc/openvpn dan copy skrip easy rsa ke dalam nya dengan cara:
mkdir -p /etc/openvpn/easy-rsa/keys
cp -rf /usr/share/easy-rsa/2.0/* /etc/openvpn/easy-rsa/
berikutnya, buat ca.key dan ca.crt, caranya edit terlebih dahulu informasi yang nantinya diperlukan, sperti nama server, logkasi server dan email, contohnya seperti ini
nano /etc/openvpn/easy-rsa/vars
edit pada bagian yang diperlukan saja seperti ini, sekali lagi edit sesuai kebutuhan, di isi sama persis juga ndak masalah :D
[...]
# Don't leave any of these fields blank.
export KEY_COUNTRY="US"
export KEY_PROVINCE="CA"
export KEY_CITY="LA"
export KEY_ORG="tehanget"
export KEY_EMAIL="tehangetvpn@gmail.com"
export KEY_OU="tehanget.info"
[...]
simpan dengan cara ctrl + x, konfirm y, enter. kemudian pindah ke folder /etc/openvpn/easy-rsa/ dengan cara
cd /etc/openvpn/easy-rsa/

saatnya kita membuat certificate server dan client...
masukin satu satu mas brooo....
cp openssl-1.0.0.cnf openssl.cnf
source ./vars
./clean-all
build ca.crt dan ca.key dulu....
./build-ca
Generating a 2048 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) [US]: ----> Press Enter
State or Province Name (full name) [CA]: ----> Press Enter
Locality Name (eg, city) [LA]: ----> Press Enter
Organization Name (eg, company) [TEHANGET]: ----> Press Enter
Organizational Unit Name (eg, section) [TEHANGET]: ----> Press Enter
Common Name (eg, your name or your server's hostname) [TEHANGET]: ----> Press Enter
Name [EasyRSA]: ----> Press Enter
Email Address [tehangetvpn@gmail.com]: ----> Press Enter  
lanjut bikin server key...
./build-key-server server
kurang lebih seperti ini:

enerating a 2048 bit RSA private key
....................+++
.............+++
writing new private key to 'server.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.
----- 
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: ----> Press Enter      
An optional company name []: ----> Press Enter
Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           :PRINTABLE:'US'
stateOrProvinceName   :PRINTABLE:'CA'
localityName          :PRINTABLE:'LA'
organizationName      :PRINTABLE:'TEHANGET'
organizationalUnitName:PRINTABLE:'TEHANGET'
commonName            :PRINTABLE:'TEHANGET'
name                  :PRINTABLE:'EasyRSA'
emailAddress          :IA5STRING:'tehanget@gmail.com'
Certificate is to be certified until Mar 23 12:21:34 2024 GMT (3650 days)
Sign the certificate? [y/n]:y ----> Type Y and Press Enter

1 out of 1 certificate requests certified, commit? [y/n]y ----> Type Y and Press Enter
Write out database with 1 new entries
Data Base Updated
waahh capek juga... lanjutt!!!
build certificate buat client...
./build-key client

seperti ini ya...
Generating a 2048 bit RSA private key
.......+++
..................................................................................................+++
writing new private key to 'client.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.
-----
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: ----> Press Enter      
An optional company name []: ----> Press Enter
Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
countryName           :PRINTABLE:'US'
stateOrProvinceName   :PRINTABLE:'CA'
localityName          :PRINTABLE:'LA'
organizationName      :PRINTABLE:'TEHANGET'
organizationalUnitName:PRINTABLE:'TEHANGET'
commonName            :PRINTABLE:'TEHANGET'
name                  :PRINTABLE:'EasyRSA'
emailAddress          :IA5STRING:'tehanget@gmail.com'
Certificate is to be certified until Mar 23 12:21:34 2024 GMT (3650 days)
Sign the certificate? [y/n]:y ----> Type Y and Press Enter

1 out of 1 certificate requests certified, commit? [y/n]y ----> Type Y and Press Enter
Write out database with 1 new entries
Data Base Updated
langkah selanjutnya adalam membuat/generate deffie helman parameter (dh)...
./build-dh
tunggu aja sampe selesai proses buidl nya, hanya beberapa menit kok hahaha.... :p
-------
alhamdulilah selesai juga bikin server key dan clietn key... sekarang pindah keys tersebut ke /etc/openvpn dengan cara
cd /etc/openvpn/easy-rsa/keys/
cp dh2048.pem ca.crt server.crt server.key /etc/openvpn/
saat paling di tunggu..... buat server.conf
cd /etc/openpvn
nano server.conf
paste kan konfig berikut
port 444
proto tcp
dev tun
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
reneg-sec 0
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
plugin /usr/lib/openvpn/plugin/lib/openvpn-auth-pam.so  /etc/pam.d/login
client-cert-not-required
username-as-common-name
server 10.9.8.0 255.255.255.0
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 5 30
comp-lzo
persist-key
persist-tun
verb 3
save dengan cara ctrt x tekan y tekan enter, contoh diatas saya menggunakan mode tcp pada port 444

last step! forwading dan routing.... untuk forwarding caranya seperti ini:
nano  /etc/sysctl.conf
ubah bagian ini, save dan exit
net.ipv4.ip_forward = 1
apply kasikan dengan cara
sysctl -p

untuk routing harus sangat di perhatikan, pilih salah satu!
untuk openvz
iptables -t nat -A POSTROUTING -s 10.9.8.0/24 -o venet0 -j SNAT --to IP_ENTE
untuk dedicated / kvm /cloud
iptables -t nat -A POSTROUTING -s 10.9.8.0/24 -o eth0 -j MASQUERADE
service iptables save 
forwarding dan routing selesai.... restart openvpnnya

service openvpn restart

wahahahaaaa... puyeengg kan?!?!?!

untuk konfigurasi client di windos silahkan baca konfigurasi openvpn cient on weduzz
bedanya, lokasi ca.crt nya ada di /etc/openvpn

selamat mencoba!!!

Selasa, 03 Juni 2014

How to Install Squid 2.6 on Centos 5.x and 6.x

squid pada centos 5.x dan atau 6.x adalah squid 2.6, ini agak berbeda dari squid 3 yang ada di debian, sedikit perbedaan tidak masalah harusnya. pastikan anda sudah meng-update repository anda, jika belum silahkan baca totor cara menambahkan EPEL Repository pada cent OS 5.x dan 6.x

step pertama: 
yum install nano 
yum install squid
 step ke dua, edit file squid .conf dengan cara

nano /etc/squid/squid.conf
tambahkan baris ini di atas sendiri:
#add define hostname
visible_hostname tehanget.info
# add auth_params
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 2
auth_param basic realm My Proxy Server
auth_param basic credentialsttl 24 hours
auth_param basic casesensitive off
# add acl rules
acl users proxy_auth REQUIRED
# http access rules
http_access deny !users
http_access allow users
#hide IP
forwarded_for off
kurang lebih jadi seperti ini:

save configurasi dengan ctrl + x konfirm y, enter. secara defaut port squid diatas akan terpasang di port 3128, kalo anda mau menggantinya silahkan edit pada bagian http_port 3128

langkah selanjutnya, membuat file database passwd

touch /etc/squid/passwd
chown root.squid /etc/squid/passwd
chmod 640 /etc/squid/passwd
 untuk menambah user caranya seperti ini
 htpasswd /etc/squid/passwd namauser
masukan passwd untuk user yang anda buat. dan  untuk menghapus user caranya seperti ini
 htpasswd -D /etc/squid/passwd namauser
terakhir, jalankan atau restart squid servernya dengan cara
 service squid start 
atau
 service squid restart
okee!! done!!! silahkan cek squid proxy ente work tidak.....

Cara Menambahkan EPEL Repository pada Cent OS 5.x dan 6.x


saat pertamakali setup atau install vps cent os, ritual  ini sangat wajib dilakukan karena pada reopsitory ini terdapat banyak sekali packages yang paling sering di gunakan.....

apa itu EPEL?? EPEL kepanjangan darExtra Packages for Enterprise Linux, apa itu?? haha cari tau sendiri aja lah... :p
langsung saja, login ke ssh as root;

untuk cent os 5.x
wget http://epel.mirror.net.in/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh epel-release-5-4.noarch.rpm
untuk cent os 6.x
wget http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
habis itu tinggal ketik
yum install update
yosh!! done!