I'm attempting to configure an openvpn client on a raspberry pi 3 b+. The raspberry pi is running CentOS 7 armhfp.
I installed openvpn from the EPEL repository for armhfp platforms. I've placed my config and associated keys and auth file in /etc/openvpn
[root@raspberrypi openvpn]# ll total 24 drwxr-x---. 2 root openvpn 4096 Jan 1 1970 client -rwxrwxrwx. 1 root root 2186 Jan 25 22:17 mullvad_ca.crt -rwxrwxrwx. 1 root root 985 Jan 1 1970 mullvad_us.conf -rwxrwxrwx. 1 root root 19 Jan 25 22:17 mullvad_userpass.txt drwxr-x---. 2 root openvpn 4096 Nov 18 14:06 server -rwxrwxrwx. 1 root root 1301 Jan 25 22:17 update-resolv-conf [root@raspberrypi openvpn]#
I'm attempting to start the service with the command: systemctl start openvpn-client@mullvad_us
When I do it fails with the following status:
[root@raspberrypi openvpn]# systemctl status openvpn-client@mullvad_us -l ● openvpn-client@mullvad_us.service - OpenVPN tunnel for mullvad_us Loaded: loaded (/usr/lib/systemd/system/openvpn-client@.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Sun 2020-01-26 01:17:19 UTC; 3h 10min ago Docs: man:openvpn(8) https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage https://community.openvpn.net/openvpn/wiki/HOWTO Process: 994 ExecStart=/usr/sbin/openvpn --suppress-timestamps --nobind --config %i.conf (code=exited, status=1/FAILURE) Main PID: 994 (code=exited, status=1/FAILURE) Jan 26 01:17:19 raspberrypi systemd: Starting OpenVPN tunnel for mullvad_us... Jan 26 01:17:19 raspberrypi openvpn: Options error: In [CMD-LINE]:1: Error opening configuration file: mullvad_us.conf Jan 26 01:17:19 raspberrypi openvpn: Use --help for more information. Jan 26 01:17:19 raspberrypi systemd: openvpn-client@mullvad_us.service: main process exited, code=exited, status=1/FAILURE Jan 26 01:17:19 raspberrypi systemd: Failed to start OpenVPN tunnel for mullvad_us. Jan 26 01:17:19 raspberrypi systemd: Unit openvpn-client@mullvad_us.service entered failed state. Jan 26 01:17:19 raspberrypi systemd: openvpn-client@mullvad_us.service failed.
It appears to be failing to read my mullvad_us.conf file. I've given it full 777 permissions as well as tried to change its ownership to openvpn:openvpn. I've also disabled selinux just in case that's the problem. I've also moved the files into /etc/openvpn/client with no success as well.
If I start openvpn from the command line it works fine. I'll run the command: "nohup openvpn --config /etc/openvpn/mullvad_us.conf &" and the tunnel builds and forms correctly.
I just can't get it to come up automatically at bootup. I'm planning to run this in a headless manner and don't want to have to ssh into the device each time I power it on just to get the vpn tunnel up.
I've seen articles online saying to edit the file at /etc/default/openvpn but that file doesn't exist for some reason and I can't help but think it's due to the flavor of CentOS that I'm running. At this point I'm pretty stumped. Any help would be hugely appreciated.