Start OpenVPN connection on boot

I am trying to connect to OpenVPN on boot.
I’m a brand new Fedora Workstation 32 user who just switched from Zorin.

Following online guides to start an OpenVPN connection on boot worked for me in Zorin, but not in Fedora Workstation 32. I’m able to get OpenVPN running both in terminal and network manager, but neither starts automatically on reboot.
The guide from my VPN provider states:

Then you will have to edit the startup on boot file via this command:
sudo gedit /etc/default/openvpn
When the text editor opens, add this line above #AUTOSTART=“all”:AUTOSTART=“al-tia.conf”
Save the file and reboot your Linux device.

The issue is that there is no file located at /etc/default/openvpn in Fedora. Does anyone know why installing OpenVPN in Fedora doesn’t create this file? Is it stored somewhere else?

Thanks in advance for your help!

Hello @purist, welcome to Fedora! Please take a minute to go through the introductory posts in the #start-here category. They include useful information on debugging and using the forum better.

No, the package does not include it. Try: rpm -ql openvpn.

Does your howto ask you to create the file perhaps?

Thanks for the welcome @FranciscoD.
In Debian/Ubuntu the file was generated when installing OpenVPN. What I really need is to know in which directory Fedora would look for the “startup on boot” file that contains the AUTOSTART=“all” code.

rpm -ql openvpn` outputs:

/etc/openvpn
/etc/openvpn/client
/etc/openvpn/server
/run/openvpn-client
/run/openvpn-server
/usr/lib/.build-id
/usr/lib/.build-id/79
/usr/lib/.build-id/79/980ce8b391a9d9fe940443b3e900ebbfebe8d3
/usr/lib/.build-id/87
/usr/lib/.build-id/87/db5e9710b0523f1c50c05069a3f9ade0cc5823
/usr/lib/.build-id/f8
/usr/lib/.build-id/f8/d696be4cff5bfde8c045b39028c231600333f2
/usr/lib/systemd/system/openvpn-client@.service
/usr/lib/systemd/system/openvpn-server@.service
/usr/lib/tmpfiles.d/openvpn.conf
/usr/lib64/openvpn
/usr/lib64/openvpn/plugins
/usr/lib64/openvpn/plugins/openvpn-plugin-auth-pam.so
/usr/lib64/openvpn/plugins/openvpn-plugin-down-root.so
/usr/sbin/openvpn
/usr/share/doc/openvpn
/usr/share/doc/openvpn/AUTHORS
/usr/share/doc/openvpn/COPYING
/usr/share/doc/openvpn/COPYRIGHT.GPL
/usr/share/doc/openvpn/ChangeLog
/usr/share/doc/openvpn/Changes.rst
/usr/share/doc/openvpn/README
/usr/share/doc/openvpn/README.auth-pam
/usr/share/doc/openvpn/README.down-root
/usr/share/doc/openvpn/README.systemd
/usr/share/doc/openvpn/contrib
/usr/share/doc/openvpn/contrib/OCSP_check
/usr/share/doc/openvpn/contrib/OCSP_check/OCSP_check.sh
/usr/share/doc/openvpn/contrib/README
/usr/share/doc/openvpn/contrib/openvpn-fwmarkroute-1.00
/usr/share/doc/openvpn/contrib/openvpn-fwmarkroute-1.00/README
/usr/share/doc/openvpn/contrib/openvpn-fwmarkroute-1.00/fwmarkroute.down
/usr/share/doc/openvpn/contrib/openvpn-fwmarkroute-1.00/fwmarkroute.up
/usr/share/doc/openvpn/contrib/pull-resolv-conf
/usr/share/doc/openvpn/contrib/pull-resolv-conf/client.down
/usr/share/doc/openvpn/contrib/pull-resolv-conf/client.up
/usr/share/doc/openvpn/management-notes.txt
/usr/share/doc/openvpn/sample
/usr/share/doc/openvpn/sample/sample-config-files
/usr/share/doc/openvpn/sample/sample-config-files/README
/usr/share/doc/openvpn/sample/sample-config-files/client.conf
/usr/share/doc/openvpn/sample/sample-config-files/firewall.sh
/usr/share/doc/openvpn/sample/sample-config-files/home.up
/usr/share/doc/openvpn/sample/sample-config-files/loopback-client
/usr/share/doc/openvpn/sample/sample-config-files/loopback-server
/usr/share/doc/openvpn/sample/sample-config-files/office.up
/usr/share/doc/openvpn/sample/sample-config-files/openvpn-shutdown.sh
/usr/share/doc/openvpn/sample/sample-config-files/openvpn-startup.sh
/usr/share/doc/openvpn/sample/sample-config-files/roadwarrior-client.conf
/usr/share/doc/openvpn/sample/sample-config-files/roadwarrior-server.conf
/usr/share/doc/openvpn/sample/sample-config-files/server.conf
/usr/share/doc/openvpn/sample/sample-config-files/static-home.conf
/usr/share/doc/openvpn/sample/sample-config-files/static-office.conf
/usr/share/doc/openvpn/sample/sample-config-files/tls-home.conf
/usr/share/doc/openvpn/sample/sample-config-files/tls-office.conf
/usr/share/doc/openvpn/sample/sample-config-files/xinetd-client-config
/usr/share/doc/openvpn/sample/sample-config-files/xinetd-server-config
/usr/share/doc/openvpn/sample/sample-scripts
/usr/share/doc/openvpn/sample/sample-scripts/auth-pam.pl
/usr/share/doc/openvpn/sample/sample-scripts/bridge-start
/usr/share/doc/openvpn/sample/sample-scripts/bridge-stop
/usr/share/doc/openvpn/sample/sample-scripts/ucn.pl
/usr/share/doc/openvpn/sample/sample-scripts/verify-cn
/usr/share/doc/openvpn/sample/sample-windows
/usr/share/doc/openvpn/sample/sample-windows/sample.ovpn
/usr/share/man/man8/openvpn.8.gz
/var/lib/openvpn

This is how you set up OpenVPN with systemd:
https://community.openvpn.net/openvpn/wiki/Systemd

It also explains how to start the connection at boot.

1 Like

Hi,

I’m presuming you vpn configuration file is "al-tia.conf” and if you are following an up to date guide, this file should be located (along with any other client files required, such as certs or login credentials), in /etc/openvpn/client

Then issuing:

sudo systemctl enable openvpn-client@al-tia

You can test, with vpn disconnected and issuing:

sudo systemctl start openvpn-client@al-tia

Thanks Tom.

1 Like

This worked. Thanks!

1 Like