Problem: Can connect to server but can't connect to the internet

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
Spyagent1000
OpenVpn Newbie
Posts: 1
Joined: Sun Nov 27, 2016 9:29 pm

Problem: Can connect to server but can't connect to the internet

Post by Spyagent1000 » Sun Nov 27, 2016 9:39 pm

Last week I set up an Ubuntu 10.04 server at home in order to set up OpenVpn, I followed a guide and everything was going fine. I got it set up and my clients can connect, but after I connect to any websites. I can ping my server from the client, but the server cannot ping the client. The client also cannot ping google (8.8.8.8) when connected. Here are my settings..

server.conf

Code: Select all

port 1194
proto udp
dev tun
sndbuf 0
rcvbuf 0
ca ca.crt
cert server.crt
key server.key
dh dh.pem
tls-auth ta.key 0
topology subnet
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
cipher AES-128-CBC
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
crl-verify crl.pem
client.ovpn

Code: Select all

client
dev tun
proto udp
sndbuf 0
rcvbuf 0
remote SERVER IP 1194
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
cipher AES-128-CBC
comp-lzo
setenv opt block-outside-dns
key-direction 1
verb 3
firewall settings

Code: Select all

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to SERVER IP

I believe that I have some sort of routing problem as when I run route -n I get

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    0      0        0 enp2s0
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 enp2s0
10.8.0.0        0.0.0.0         255.255.255.0   U     0      0        0 tun0
I get this both when the client is connected and when it's disconnected.

I also have ipv4 forwarded and the 1194 forwarded.

I'm fairly new to this and I've been troubleshooting for days with no avail, any help would be greatly appreciated.

Post Reply