Tuesday, October 12, 2010

Cara Install OpenVPN Untuk Tunneling

ls -al /dev/net/tunls -al /dev/net/tun
ls
dir
yum install gcc
wget http://openvpn.net/release/openvpn-2.0.9.tar.gz
wget http://openvpn.net/release/lzo-1.08-4.rf.src.rpm
yum install rpm-build
yum install autoconf.noarch
yum install zlib-devel
yum install pam-devel
yum install openssl-devel
yum install make
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
cp -r /usr/share/doc/openvpn-2.0.9/easy-rsa/2.0 /etc/openvpn/easy-rsa -R
cd /etc/openvpn/easy-rsa/
source ./vars
./vars
./clean-all
./build-ca
./build-key-server mobinity
./build-dh
cd /etc/openvpn/easy-rsa/keys
rename folder keys jadi 1194 menggunakan winscp dan download file ca.crt ke computer anda.dan block semua file yg ada di folder 1194 rubah common nya jadi 0777.
cd /etc/openvpn/
dir
rm server.conf
y
vi server.conf
a
paste config yang mau dipasang seperti dibawah ini:

port 1194
proto tcp-server
dev tun
plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so /etc/pam.d/login
client-cert-not-required
username-as-common-name
ca /etc/openvpn/easy-rsa/1194/ca.crt
cert /etc/openvpn/easy-rsa/1194/mobinity.crt
key /etc/openvpn/easy-rsa/1194/mobinity.key
dh /etc/openvpn/easy-rsa/1194/dh1024.pem
server 10.9.0.0 255.255.255.0
ifconfig-pool-persist ip-1194.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 bf-cbc
max-clients 140
user nobody
persist-key
persist-tun
verb 3
comp-lzo

esc
:update
:exit

cat /dev/net/tun
service openvpn start
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 127.0.0.0/24 -o venet0 -j SNAT --to 117.103.xxx.xxx << service iptables status
service iptables save
service openvpn restart

2 comments:

  1. permisi...mas nanya donk settingan file config buat clientnya gmn ?
    sy cb bt confignya di bawah

    client
    dev tun
    proto tcp-server
    remote 111.xxx.xxx.xx 1194
    resolv-retry infinite
    route-method exe
    resolv-retry infinite
    nobind
    persist-key
    persist-tun
    ca ca.crt
    auth-user-pass
    comp-lzo
    verb 3

    udah bener blom itu mas,tp sy cb konek blom mau konek dia mas, pliis bantuannya buat confignya aja, karna tutor d atas udh jls bgt lngsung sy cb oke udah mantap gak ada yg error waktu codingnya ,vps ku udah siap tp mslhnya config clientnya, tlong d contohin mas
    oke makasih mas tutornya

    ReplyDelete
  2. Rubah commonnya 0777 gimana ya, bisa di per detailkan,

    ReplyDelete

My Mine