Traffic wroteThe
recommended iptables rule is:
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
Thanks Traffic. Tried that also, but nothing doing. Have also now tried connected using Openvpn Connect on an Android device, and it does not work either (connects, but no traffic flowing).
Part of the issue for me self-diagnosing this, is that I'm not sure I fully understand the way the traffic is meant to flow. My understanding so far is as follows:
- My raspberry Pi has a local lan IP of 192.168.0.7
- The gateway on the lan is the ADSL modem/router, with IP 192.168.0.1
- ignoring openvpn for a moment, the Pi has internet connectivity as I am able to ping externally and download updates etc
- My Openvpn server on the Pi has an IP address of 10.8.0.1
- It hands out a client IP address to my iPad or android tablet of 10.8.0.6
- I am testing by having the client on a 4G mobile network, to remove any local LAN to local LAN confusions
- given that the client and server get a connection, there is at least some level of connectivity between the client and the openvpn server
- I now come to two parts I don't know enough about.
- First, what part of all the config is the part that tells the openvpn server IP address (10.8.0.1), that it needs to go through the Local LAN address of the Pi (eth0 = 192.168.0.7) to access stuff? I'm guessing that's the line in server.conf that says "local 192.168.0.7". I have assumed that other than installing openvpn server on the Pi, nothing additional needs to be done with routes or firewalls or anything else, to enable that leg of the connectivity chain?
- Second, how do the vpn client IP addresses know where to route stuff? I though this was the part as shown above about nat-ing the 10.8.0.0 network through 192.168.0.7?