dagrha / pypia

Configuration of Private Internet Access VPN routes for Linux
GNU General Public License v3.0
78 stars 15 forks source link

NetworkManager re-connect to vpn on boot? #42

Closed averyfreeman closed 5 years ago

averyfreeman commented 5 years ago

Hi,

I'm wondering if you could help me figure out how to get the VPN to re-connect automatically on boot

I'm on Fedora 30 headless with nmtui. Installed using pypia very basic (no flags, thought I was just testing but it worked so I ran with it).

I'm asking here because I'm confused, pypia didn't install .conf files I would expect for openvpn in /etc/openvpn/client

Thank you for the help and the great user-friendly script

dagrha commented 5 years ago

Hi there, sorry for the slow reply on this.

One approach would be to use cron or systemd to run a script at startup. Here's an example of how you might set up your crontab if you wanted to use cron to invoke pypia on startup: https://askubuntu.com/a/816

pypia actually doesn't use openvpn conf files. It instead lets NetworkManager handle all of the interaction with OpenVPN and just creates nm keyfiles that live in /etc/NetworkManager/system-connections/. The keyfiles should show up in the NetworkManager applet of a desktop environment, and I imagine they would be listed somewhere is nmtui, though admittedly I've never tried it. I'm not sure vanilla OpenVPN conf files would be listed in nm-applet or nmtui.

That said, if you'd prefer OpenVPN conf files, check out the project pia which is a set of shell scripts that are helpful for initiating PIA connections directly with OpenVPN.