当使用作为服务启动 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
如果您使用的是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
。