After installing openvpn on Ubuntu and CentOS and running into the same problem, I'm a bit desperate for help. I've been through every other thread with the same problem and the solutions aren't working.
I've installed OpenVPN on a CentOS server and I'm using TunnelBlick on a Mac. The server and client connect fine, and can ping each other, but I cannot access or ping anything from the client machine (including any DNS servers it's not a dns problem).
Here's my server.conf:
local x.x.x.x (my public IP)
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh1024.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
persist-key
persist-tun
status openvpn-status.log
verb 3
And client:
client
dev tun
proto udp
remote x.x.x.x (public ip again) 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
ns-cert-type server
comp-lzo
verb 3
The usual problem of forwarding ips is fine, sysctl -p reads:
sysctl -p
net.ipv4.ip_forward = 1
And iptables -L reads:
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:openvpn
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
While iptables -S reads:
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-A INPUT -p udp -m udp --dport 1194 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A INPUT -i tun0 -j ACCEPT
-A INPUT -i eth0 -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
I've run the usual "iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE" and nothing improves.
I am trying to connect from my Mac via a router, I'm not sure if this could be a problem and how to avoid it?
I've looked through about 50 threads today on this and haven't found a solution, can anyone help?
Thanks!