Hello Martijn,
On 26/09/15 21:45, Martijn Grooten wrote:
echo 1 > /proc/sys/net/ipv4/ip_forward
As was advised by Hugo and GM, there are two ways to do this, so choose
the one that makes the most sense to you. I normally put it in
/etc/rc.local purely because it's easier to backup that single file
reliably, but pedantically speaking the /etc/sysctl.conf file is the
technically "more correct" place to enable this configuration.
modprobe tun
You should not have to do this, the kernel module should auto-load once
you start OpenVPN.
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o
eth0 -j MASQUERADE
This one is the crucial step, because it allows IP addresses from your
VPN range to be translated. Without this nothing will work, because none
of the 10.x.x.x (or for that matter all of the RFC 1918 address ranges)
addresses are specifically not routed over the public internet. Again,
there are more than one way to do this depending on the distro you are
running. The /etc/rc.local file is again a good place to centralise
this, although your distro might have another more "technically correct"
place (CentOS uses /etc/sysconfig/iptables, Debian and Ubuntu have their
own schema).
/etc/init.d/openvpn restart
If OpenVPN is configured to start at boot-up via the normal start-up
scripts, you should not have to restart OpenVPN in this manner. The IP
forwarding and iptables masquerading bits will enable routing to happen
properly.
--
Regards,
Jan Henkins