Openvpn 无法在 systemd 中启动,20.04

Openvpn 无法在 systemd 中启动,20.04

新的客户端配置。我可以启动 openvpn 并通过可执行文件进行连接,但 systemd 无法启动 openvpn

我试过

systemctl start [email protected]

systemctl start openvpn@server

systemctl start openvpn@service

systemctl start openvpn

使用该命令,结果都一样service。同样启动失败。

我有配置文件

/etc/openvpn/

/etc/openvpn/client

日志似乎表明它找到了我的配置文件,但并未消化它。然后继续在另一个目录中寻找它喜欢的东西。

日志:

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.

配置:

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

所有配置文件都是chmod 777

如何让 systemd 启动 openvpn?

附加问题:

通过可执行文件启动时,我在这个客户端上也无法获取 DNS。但这是我的下一个问题。也许 systemd 会修复它。

相关内容