Just thought I’d report this here in case anyone else falls over it.
Been rebuilding my VPN box (Pi2 with DietPi, Wireguard, PiVPN [for OpenVPN] and a few bits like Fail2Ban and RPI Monitor) and came across the problem with the OpenVPN server. It sets up fine and devices can connect to it via profiles produced by it, but those devices cannot connect further (intranet or internet).
Turns out that by default PiVPN isn’t setting the traffic forwarding flag, and so nothing is getting out of the server.
There are two ways to fix this, neither being particularly complicated.
- At the command line enter:
pivpn -d
That will run PiVPN in diagnostic mode, where it will find the issue and offer a yes/no to fix it (obviously put “y”).
- You can also manually set the flag up by doing:
echo 1 > /proc/sys/net/ipv4/ip_forward
After doing either of those, it works fine. Just thought I’d share anyway - indeed it would be better if this was set automatically during install (or at least an option given to do so).
Edited to add - just had to reboot and it switched itself back off again? So this does need some fixing I think to work reliably out of the box and after rebooting…