pivpn: Possible conflict between ufw and iptables-persistent
I’ve noticed this during the installation: if you have ufw
installed/enabled the vpn is not going to work even after a reboot because iptables-persistent
interferes with ufw
(I guess) and doesn’t let ufw
apply new rules (for example allow from 1194/udp and allow from vpn network), result of course is that the port is blocked.
As a workaround i just did sudo ufw disable
and sudo ufw enable
. It worked but rules did not stick after reboot. Basically sudo ufw status verbose
tells you that the rules are in place but sudo iptables -vnL
does not (they are not present in the chain).
The actual solution was to uninstall iptables-persistent
and it’s depencency: sudo apt remove iptables-persistent
and sudo apt autoremove
.
Hope it helps, I’m running Raspbian Stretch.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 14
- Comments: 15 (6 by maintainers)
There shouldn’t be any drawbacks of using /etc/rc.local to start the service, however the proper way to automatically start a service on reboot (iptables-persistent in this case) is:
sudo systemctl enable iptables-persistent
, if you want to start the service at runtime instead:sudo systemctl start iptables-persistent
. For me I only keep ufw installed and let him apply the rules.