[Solved]Client connects but no internet access
Posted: Sat May 09, 2015 3:50 pm
My goal is pretty straightforward; I want to tunnel all client traffic through VPN. Establishing the connection is easy enough but the client can no longer access the internet (ping 8.8.8.8 fails). I've been banging my head against this on and off for a few days now with no luck.
Here is what I'm getting on the client computer. First, the route without VPN:
Route after VPN connection (45.33.15.172 is the VPN server address):
And finally pinging first the VPN server then google dns (after VPN connection):
server.conf
To minimize firewall interference I tried to turn everything off and then just enable forwarding (blindly following commands from https://wiki.archlinux.org/index.php/Internet_sharing). I have tried everything with a "normal" firewall as well but same behavior.
From the same site I also confirmed that ip forwarding is enable on the system
Here is what I'm getting on the client computer. First, the route without VPN:
Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.50.1 0.0.0.0 UG 202 0 0 eth0
192.168.50.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
Code: Select all
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.8.0.13 128.0.0.0 UG 0 0 0 tun0
0.0.0.0 192.168.50.1 0.0.0.0 UG 202 0 0 eth0
10.8.0.1 10.8.0.13 255.255.255.255 UGH 0 0 0 tun0
10.8.0.13 0.0.0.0 255.255.255.255 UH 0 0 0 tun0
45.33.15.172 192.168.50.1 255.255.255.255 UGH 0 0 0 eth0
128.0.0.0 10.8.0.13 128.0.0.0 UG 0 0 0 tun0
192.168.50.0 0.0.0.0 255.255.255.0 U 202 0 0 eth0
Code: Select all
[] # ping 45.33.15.172
PING 45.33.15.172 (45.33.15.172) 56(84) bytes of data.
64 bytes from 45.33.15.172: icmp_seq=1 ttl=51 time=65.4 ms
64 bytes from 45.33.15.172: icmp_seq=2 ttl=51 time=66.0 ms
64 bytes from 45.33.15.172: icmp_seq=3 ttl=51 time=65.5 ms
--- 45.33.15.172 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 65.423/65.666/66.037/0.398 ms
[] #
[] # ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2008ms
Code: Select all
port ****
proto udp
dev tun
ca /etc/openvpn/ca.crt
cert /etc/openvpn/****.crt
key /etc/openvpn/****.key
dh /etc/openvpn/dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1"
keepalive 10 120
comp-lzo
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3
Code: Select all
[]# iptables -nvL
Chain INPUT (policy ACCEPT 765 packets, 67440 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 8 packets, 672 bytes)
pkts bytes target prot opt in out source destination
72 6048 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
25 1924 ACCEPT all -- tun0 eth0 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 682 packets, 131K bytes)
pkts bytes target prot opt in out source destination
Code: Select all
[] # sysctl -a | grep forwarding
net.ipv4.conf.all.forwarding = 1
net.ipv4.conf.all.mc_forwarding = 0
net.ipv4.conf.default.forwarding = 1
net.ipv4.conf.default.mc_forwarding = 0
net.ipv4.conf.dummy0.forwarding = 1
net.ipv4.conf.dummy0.mc_forwarding = 0
net.ipv4.conf.eth0.forwarding = 0
net.ipv4.conf.eth0.mc_forwarding = 0
net.ipv4.conf.gre0.forwarding = 1
net.ipv4.conf.gre0.mc_forwarding = 0
net.ipv4.conf.gretap0.forwarding = 1
net.ipv4.conf.gretap0.mc_forwarding = 0
net.ipv4.conf.ip6_vti0.forwarding = 1
net.ipv4.conf.ip6_vti0.mc_forwarding = 0
net.ipv4.conf.ip6gre0.forwarding = 1
net.ipv4.conf.ip6gre0.mc_forwarding = 0
net.ipv4.conf.ip6tnl0.forwarding = 1
net.ipv4.conf.ip6tnl0.mc_forwarding = 0
net.ipv4.conf.ip_vti0.forwarding = 1
net.ipv4.conf.ip_vti0.mc_forwarding = 0
net.ipv4.conf.lo.forwarding = 1
net.ipv4.conf.lo.mc_forwarding = 0
net.ipv4.conf.sit0.forwarding = 1
net.ipv4.conf.sit0.mc_forwarding = 0
net.ipv4.conf.teql0.forwarding = 1
net.ipv4.conf.teql0.mc_forwarding = 0
net.ipv4.conf.tun0.forwarding = 1
net.ipv4.conf.tun0.mc_forwarding = 0
net.ipv4.conf.tunl0.forwarding = 1
net.ipv4.conf.tunl0.mc_forwarding = 0
net.ipv4.ip_forward = 1
net.ipv4.ip_forward_use_pmtu = 0
net.ipv6.conf.all.forwarding = 1
net.ipv6.conf.default.forwarding = 1
net.ipv6.conf.dummy0.forwarding = 1
net.ipv6.conf.eth0.forwarding = 0
net.ipv6.conf.gre0.forwarding = 1
net.ipv6.conf.gretap0.forwarding = 1
net.ipv6.conf.ip6_vti0.forwarding = 1
net.ipv6.conf.ip6gre0.forwarding = 1
net.ipv6.conf.ip6tnl0.forwarding = 1
net.ipv6.conf.ip_vti0.forwarding = 1
net.ipv6.conf.lo.forwarding = 1
net.ipv6.conf.sit0.forwarding = 1
net.ipv6.conf.teql0.forwarding = 1
net.ipv6.conf.tun0.forwarding = 1
net.ipv6.conf.tunl0.forwarding = 1