Ok so here's my problem :
I can connect to my VPN server (ping server <-> client OK) and route all traffic from my client to my server but then I cannot access the Internet in any way.
I am sure all traffic is sent to the server because I cannot access any page or ping anything from the point I connect to my server, and I am sure the packets sent by my client get to my server because here's the output of
iptables -t nat -L -n -v on the server :
Chain PREROUTING (policy ACCEPT 6 packets, 454 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 2 packets, 240 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 1 packets, 60 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 1 packets, 60 bytes)
pkts bytes target prot opt in out source destination
4 214 MASQUERADE all -- * eth0 10.42.24.0/24 0.0.0.0/0
I have no firewall set up and I have ip forwarding enabled (/etc/rc.d/ip_forward started), so i don't see where the problem could be...
Also it is worth mentioning that the
-j SNAT --to-source x.x.x.x option did not work at all (packets aren't even logged in the iptables rule).
Here is my config :
SERVER
proto udp
dev tun
ca /etc/openvpn/certs/ca.crt
cert /etc/openvpn/certs/NaughtyVPN.crt
key /etc/openvpn/keys/NaughtyVPN.key # This file should be kept secret
dh /etc/openvpn/certs/dh2048.pem
server 10.42.24.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
keepalive 10 120
tls-auth /etc/openvpn/keys/ta.key 0
comp-lzo
user nobody
group nobody
persist-key
persist-tun
status openvpn-status.log
verb 3
daemon
askpass /root/password.ovpn
auth-nocache
CLIENT
client
dev tun
proto udp
remote a.b.c.d 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca /etc/openvpn/certs/naughtyca.crt
cert /etc/openvpn/certs/naughtyclient.crt
key /etc/openvpn/keys/naughtyclient.key
remote-cert-tls server
tls-auth /etc/openvpn/keys/ta.key 1
comp-lzo
verb 3