Score:0

Openvpn fails to start in systemd, 20.04

in flag

A new client configuration. I can launch openvpn and connect via the executable, but systemd cannot start openvpn

I tried

systemctl start [email protected]

systemctl start openvpn@server

systemctl start openvpn@service

systemctl start openvpn

and all the same using the service command. Same start failure.

I have the config file in

/etc/openvpn/

/etc/openvpn/client

The logs appear to indicate it finds my config file but does not digest it. And then proceeds to look in another directory for something it likes.

logs:

Oct 31 00:00:01 brad-lappy2 openvpn[116161]: WARNING: Compression for receiving enabled. Compression has been used in the past to break encryption. Sent packets are not compressed unless "allow-compression yes" is also set.
Oct 31 00:00:01 brad-lappy2 ovpn-.service[116162]: Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/.service.conf
Oct 31 00:00:01 brad-lappy2 ovpn-.service[116162]: Use --help for more information.
Oct 31 00:00:01 brad-lappy2 ovpn-server[116164]: WARNING: Compression for receiving enabled. Compression has been used in the past to break encryption. Sent packets are not compressed unless "allow-compression yes" is also set.
Oct 31 00:00:01 brad-lappy2 ovpn-client.service[116163]: WARNING: Compression for receiving enabled. Compression has been used in the past to break encryption. Sent packets are not compressed unless "allow-compression yes" is also set.
Oct 31 00:00:01 brad-lappy2 ovpn-service[116166]: WARNING: Compression for receiving enabled. Compression has been used in the past to break encryption. Sent packets are not compressed unless "allow-compression yes" is also set.
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Failed with result 'exit-code'.
Oct 31 00:00:01 brad-lappy2 systemd[1]: Failed to start OpenVPN connection to .service.
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Failed with result 'exit-code'.
Oct 31 00:00:01 brad-lappy2 systemd[1]: Failed to start OpenVPN service for server.
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Failed with result 'exit-code'.
Oct 31 00:00:01 brad-lappy2 systemd[1]: Failed to start OpenVPN connection to client.service.
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Failed with result 'exit-code'.
Oct 31 00:00:01 brad-lappy2 systemd[1]: Failed to start OpenVPN connection to server.
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Failed with result 'exit-code'.
Oct 31 00:00:01 brad-lappy2 ovpn-server.service[116165]: WARNING: Compression for receiving enabled. Compression has been used in the past to break encryption. Sent packets are not compressed unless "allow-compression yes" is also set.
Oct 31 00:00:01 brad-lappy2 systemd[1]: Failed to start OpenVPN connection to service.
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Oct 31 00:00:01 brad-lappy2 systemd[1]: [email protected]: Failed with result 'exit-code'.
Oct 31 00:00:01 brad-lappy2 systemd[1]: Failed to start OpenVPN connection to server.service.

config:

client
remote mypublicip
dev tun
#ifconfig 10.9.8.2 10.9.8.1
nobind
#persist-key
#persist-tun
tls-client
ca /etc/openvpn/ca.crt
cert /etc/openvpn/client2.crt
key /etc/openvpn/client2.key
comp-lzo
verb 5
ping-restart 60
log /var/log/openvpn/openvpn.log
allow-compression yes

All config files are chmod 777

How do I get systemd to launch openvpn?

Bonus question:

I'm not getting DNS either on this one client, when launching via executable. But that's my next issue. Maybe systemd will fix it.

bac0n avatar
cn flag
the "instantiated" argument `[email protected]` should have the same name as the config file (/etc/openvpn/*.conf), extension excluded.
brad avatar
in flag
@bac0n That worked. I'll post a fresh one about the DNS issue now. Thank you sincerely!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.