Kamis, 10 Februari 2011

OpenVPN On LINUX UBUNTU 10.10

# install OpenVPN 
sudo apt-get install openvpn libssl-dev openssl
# Configure it:
1. Copy kan  easy-rsa ke  openvpn folder, saya menyarankan sebelum mengcopikan easy-rsa sebaiknya kita buat directory baru diopenvpn agar pengcopyan file easy-rsa bisa cimiewww .. ;)

cd /etc/openvpn/
cp -r /usr/share/doc/openvpn/examples/easy-rsa/2.0/* /etc/openvpn/easy-rsa/
chown -R $USER /etc/openvpn/easy-rsa/
# Create the server certificates:
cd /etc/openvpn/easy-rsa/
source vars
./clean-all
./build-dh
./pkitool --initca
./pkitool --server server
cd keys
openvpn --genkey --secret ta.key
cp server.crt server.key ca.crt dh1024.pem ta.key /etc/openvpn/
# Create the client certificates:
cd /etc/openvpn/easy-rsa/
source vars
./pkitool hostname
cd ..
# change hostname to your client hostname
4. Compress the client certificate:
tar czf keys.tgz ca.crt ta.key easy-rsa/keys/hostname.crt easy-rsa/keys/hostname.key
5. Download the keys.tgz and extract it under your openvpn client.
6. Configure /etc/openvpn/server.conf
cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn/
gzip -d /etc/openvpn/server.conf.gz
# edit server.conf
dev tun
server 10.10.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
push "route 10.10.0.0 255.255.255.0"
push "redirect-gateway"
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
user nobody
group nobody
daemon
7. Start openvpn server
echo 1 > /proc/sys/net/ipv4/ip_forward #enable ip forwarding
iptables -t nat -A POSTROUTING -s 10.10.0.0/24 -o venet0 -j MASQUERADE
iptables-save > /etc/iptables.conf
echo "#!/bin/sh" > /etc/network/if-up.d/iptables
echo "iptables-restore < /etc/iptables.conf" >> /etc/network/if-up.d/iptables
chmod +x /etc/network/if-up.d/iptables
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
then:
/etc/init.d/openvpn start1. 

Nah konfigurasi OpenVPN server telah usai sudah .. Sekarang kita gunakan Windows 7 sebagai client nya ... pertama2 kita siapkan alat tempur , agar si windows bisa berguna sbg client .. :))

1. Download the keys.tgz with FTP client
2. Extract it in C:\Program Files\OpenVPN\config\
3. Run openvpn-gui, and press connect.
4. You are connected to the OpenVPN, and you can share with the other client just like using a Lan Network over the internet.
 

Tidak ada komentar:

Posting Komentar