I can't figure out why my openvpn connection is not working. It seems that it works fine on connection. I can connect to my server but once when I'm connected I can't use internet through vpn.
This is a VPS server running on Debian
Here is my openvpn server.conf file
port 1194proto udpdev tunca ca.crtcert server.crtkey server.key # This file should be kept secretdh dh2048.pemserver 10.8.0.0 255.255.255.0ifconfig-pool-persist ipp.txtpush "redirect-gateway def1"push "dhcp-option DNS 188.8.131.52"push "dhcp-option DNS 184.108.40.206"keepalive 10 120comp-lzouser nobodygroup nogrouppersist-keypersist-tunstatus openvpn-status.loglog openvpn.logverb 6mute 20
And here is my client.conf file
clientdev tunproto udpremote server_ip 1194resolv-retry infinitenobindpersist-keypersist-tunca ca.crtcert client.crtkey client.keyns-cert-type servercomp-lzoverb 3remote-cert-tls server
I've added firewall rules also to accept connection and route but strange thing is that some rules appear multiple times. Here is my iptables save file
# Generated by iptables-save v1.4.8 on Sun Dec 22 04:36:18 2013*nat:PREROUTING ACCEPT [53:9749]:POSTROUTING ACCEPT [9:675]:OUTPUT ACCEPT [9:675]-A PREROUTING -d server_ip/32 -p udp -m udp --dport 53 -j REDIRECT --to-ports 1194 -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source server_ip -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE COMMIT# Completed on Sun Dec 22 04:36:18 2013# Generated by iptables-save v1.4.8 on Sun Dec 22 04:36:18 2013*filter:INPUT ACCEPT [946:112417]:FORWARD ACCEPT [0:0]:OUTPUT ACCEPT [824:172939]-A INPUT -i tun0 -p tcp -m tcp --dport 1194 -j ACCEPT -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT -A FORWARD -s 10.8.0.0/24 -j ACCEPT -A FORWARD -j REJECT --reject-with icmp-port-unreachable -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT -A FORWARD -s 10.8.0.0/24 -j ACCEPT -A FORWARD -j REJECT --reject-with icmp-port-unreachable -A FORWARD -i eth0 -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT -A FORWARD -s 10.8.0.0/24 -o eth0 -j ACCEPT COMMIT# Completed on Sun Dec 22 04:36:18 2013
I also checked /etc/sysctl.conf to make sure that
I also have
So I've tried OpenVPN connection on my linux pc and on Virtualbox XP and both have connection but none of them have access to internet once connected.
Strangest thing of all this is when I do traceroute it shows connection through VPN.
For example I do traceroute google.com
1 my ip from vpn connection2 openvpn server ip3 ...4 ...5 ... few hops between server to google6 and finally google server ip
So traceroute shows that connection goes through vpn, and also when I ping, ping is increased to 100ms in difference when I'm not connected to vpn when ping is about 20ms.
But when I try to browse the internet with any program (firefox, chrome, iexplorer) I don't get anything. Nothing will load and connection times out.
It's not that my server is slow so pages won't load, speed test shows about 70mbit connection on server, and I have 6mbit connection.
And when I try to connect to other vpn like cloudnymous everything works fine. It's just something wrong on my openvpn setup.
EDIT: After all I thought I finally made it working, after messing around a lot of settings I finally can connect to my VPN and get internet from there.
Now I have one final problem. Since I'm on linux few programs doesn't work here and I use virtualbox with windows XP installation but when connected to vpn on virtualbox I can surf the internet. But no program can connect to the internet. Also my vpn connection is loosing internet from time to time, and it's not my internet or server connection because during that time when I loose internet over vpn I can still connect with putty over ssh to the server and do various things.