Home » OpenVPN Connect But No Internet Connection

OpenVPN Connect But No Internet Connection

openvpn

Judulnya bahasa inggris :P, udah konek ke VPN tetapi masih mendapati Unidentified Network ? tidak bisa ping ke server luar, tetapi bisa ping ke IP server VPN?

OpenVZ, tambahkan iptables dibawah ini, dimana IP server anda adalah 192.168.1.1

iptables -t nat -A POSTROUTING -o venet0 -j SNAT --to-source 192.168.1.1
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source 192.168.1.1

Xen, KVM, Dedicated server

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE

bila masih ada error, coba cek file konfigurasi server openvpn anda beserta clientnya, berikut ini saya sertakan contoh file konfigurasinya
openvpn.conf

dev tun
server 10.8.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.8.0.0 255.255.255.0"
push "redirect-gateway def1"
push "nameserver 4.2.2.1 4.2.2.2"
comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
group daemon
daemon

openvpn-client

client
remote 192.168.1.1 1194 // ganti 192.168.1.1 dengan IP server anda
dev tun
comp-lzo
ca ca.crt
cert client1.crt
key client1.key
route-delay 2
route-method exe
redirect-gateway def1
dhcp-option DNS 8.8.8.8
verb 3

openvpn

Leave a Reply

Your email address will not be published. Required fields are marked *