OpenVPN 守护进程不使用配置文件

joe*_*ell 3 debian openvpn

当使用作为服务启动 OpenVPN 时,它不使用我的/etc/openvpn/server.conf. 在查看 时/var/log/syslog,我只看到Started OpenVPN service.没有任何额外的 OpenVPN 日志记录。

当我手动启动 OpenVPN 时openvpn --config /etc/openvpn/server.conf,我得到了一堆 OpenVPN 的日志记录并且客户端可以连接到它。

如何确保将其作为服务启动时,它使用配置文件?

Debian GNU/Linux 9 OpenVPN 2.4.0 x86_64-pc-linux-gnu

Q23*_*Q23 7

如果您使用的是systemd基于 Ubuntu 16.04 或 Debian 9 之类的操作系统,则需要使用该systemctl命令而不是service

要在启动时启用:

systemctl enable openvpn@server.service

手动启动和停止:

systemctl start openvpn@server.service

systemctl stop openvpn@server.service

您可以启用,禁用开始,通过更换停止任何OpenVPN的配置这样server用的名称.conf文件/etc/openvpn