I have setup a Openvpn server on a raspberry pi and I am able to connect it using my laptop with windows 7 (wifi from multiple different external networks).
When I try to connect with my android phone or Ipad, i can get a connection. Even the webserver can be reached on the interna ip-adres.
External surfing is not possible on both devices (while on windows it is not a problem).
I get an ip adres from the openvpn server and both the server and the server IP are my external IP adres. I can browse on IP adres; but the webadresses are not resolved. IT seems that there is something wrong with my iptables.
openvpn.conf
dev tun
proto udp
port 1194
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/server.crt
key /etc/openvpn/easy-rsa/keys/server.key
dh /etc/openvpn/easy-rsa/keys/dh1024.pem
user nobody
group nogroup
server 10.8.0.0 255.255.255.0
persist-key
persist-tun
status /var/log/openvpn-status.log
verb 3
client-to-client
push "redirect-gateway def1"
#set the dns servers
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
log-append /var/log/openvpn
comp-lzo
ovpn-file
dev tun
client
proto udp
remote EXTERNAL.IP.ADRES.HERE 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client1.crt
key client1.key
comp-lzo
verb 3
Iptables in rc.local
sudo iptables -F
#activate routing:
sudo sysctl -w net/ipv4/ip_forward=1
#activate nat:
sudo iptables -t nat -F POSTROUTING
sudo iptables -t nat -A POSTROUTING -o eth0 -s 10.8.0.0/24 -j MASQUERADE
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source 192.168.1.98