我有一个 openvpn 服务器,应该由 systemd 启动。最近该服务无法启动,因为出于某种原因,它会触发提升网络接口,但 ifup 无法启动网络接口,因为它已经存在。
服务器有两个接口,一个连接到互联网(openvpn 应该监听互联网),另一个连接到 LAN。Openvpn 应该通过隧道连接到 LAN 接口。LAN 接口是发生故障的接口:enp97s0f0
Feb 20 11:03:35 server ifup[5035]: RTNETLINK answers: File exists
Feb 20 11:03:35 server ifup[5035]: ifup: failed to bring up enp97s0f0
Feb 20 11:03:35 server systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Feb 20 11:03:35 server systemd[1]: Failed to start Raise network interfaces.
-- Subject: Unit networking.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit networking.service has failed.
--
-- The result is failed.
Feb 20 11:03:35 server systemd[1]: Dependency failed for OpenVPN connection to inline.
-- Subject: Unit [email protected] has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit [email protected] has failed.
--
-- The result is dependency.
为什么 openvpn.service 在内部网络接口已经存在的情况下仍尝试提升它?
[Unit]
Description=OpenVPN service for %I
After=syslog.target network-online.target
Wants=network-online.target
Documentation=man:openvpn(8)
Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage
Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO
[Service]
Type=notify
PrivateTmp=true
RuntimeDirectory=openvpn-server
RuntimeDirectoryMode=0710
WorkingDirectory=/etc/openvpn/server
ExecStart=/usr/sbin/openvpn --status %t/openvpn-server/status-%i.log --status-version 2 --suppress-timestamps --config %i.conf
CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE
LimitNPROC=10
DeviceAllow=/dev/null rw
DeviceAllow=/dev/net/tun rw
[Install]
WantedBy=multi-user.target
我怎样才能阻止它尝试启动该接口(比如假设该接口始终处于启动状态)。