추가 읽기

추가 읽기

내 홈 네트워크에 연결해야 하는 Debian 8 Jessie 서버가 있고 집에 있는 pfSense 2.2 상자에서 OpenVPN 서버를 사용하고 있습니다. 나는 이전 데비안 버전에서는 잘 해냈기 때문에 systemd가 서비스를 제어하는 ​​방법에 대한 새로운 것을 놓치고 있는 것 같습니다...

/etc/openvpn/합리적으로 간단한 설정으로 필요한 모든 것을 갖추고 있습니다 .

client
dev tun
proto udp
remote home.dynamic-domain.com 1194
resolv-retry infinite
nobind
user nobody
group nobody
persist-tun
persist-key
ca /etc/openvpn/ca.crt
cert /etc/openvpn/hostname.crt
key /etc/openvpn/hostname.key
tls-auth /etc/openvpn/tls.key 1
cipher "AES-256-CBC"
comp-lzo
verb 3

관련 인증서/키가 존재하고 정확합니다.

수동으로 구성을 불러오면 정상적으로 작동합니다.

~# openvpn --config /etc/openvpn/servervpn.conf
Sat Jun 27 13:26:08 2015 OpenVPN 2.3.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Dec  1 2014
Sat Jun 27 13:26:08 2015 library versions: OpenSSL 1.0.1k 8 Jan 2015, LZO 2.08 
Sat Jun 27 13:26:08 2015 WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Sat Jun 27 13:26:08 2015 Control Channel Authentication: using '/etc/openvpn/servervpn/tls.key' as a OpenVPN static key file
Sat Jun 27 13:26:08 2015 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jun 27 13:26:08 2015 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jun 27 13:26:08 2015 Socket Buffers: R=[212992->131072] S=[212992->131072]
Sat Jun 27 13:26:08 2015 NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
Sat Jun 27 13:26:08 2015 UDPv4 link local: [undef]
Sat Jun 27 13:26:08 2015 UDPv4 link remote: [AF_INET]x.x.x.x:1194
Sat Jun 27 13:26:08 2015 TLS: Initial packet from [AF_INET]x.x.x.x:1194, sid=531d85a9 2201aab6
Sat Jun 27 13:26:08 2015 VERIFY OK: depth=1, xxxxxxxx
Sat Jun 27 13:26:08 2015 VERIFY OK: depth=0, xxxxxxxx
Sat Jun 27 13:26:13 2015 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Sat Jun 27 13:26:13 2015 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jun 27 13:26:13 2015 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Sat Jun 27 13:26:13 2015 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Sat Jun 27 13:26:13 2015 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Sat Jun 27 13:26:13 2015 [hm-py-router-01] Peer Connection Initiated with [AF_INET]188.78.154.7:11193
Sat Jun 27 13:26:15 2015 SENT CONTROL [hm-py-router-01]: 'PUSH_REQUEST' (status=1)
Sat Jun 27 13:26:15 2015 PUSH: Received control message: 'PUSH_REPLY,route 192.168.10.0 255.255.255.0,topology net30,ping 5,ping-restart 60,ifconfig 192.168.11.6 192.168.11.5'
Sat Jun 27 13:26:15 2015 OPTIONS IMPORT: timers and/or timeouts modified
Sat Jun 27 13:26:15 2015 OPTIONS IMPORT: --ifconfig/up options modified
Sat Jun 27 13:26:15 2015 OPTIONS IMPORT: route options modified
Sat Jun 27 13:26:15 2015 ROUTE_GATEWAY 176.126.240.1/255.255.248.0 IFACE=eth0 HWADDR=00:16:3c:89:81:e0
Sat Jun 27 13:26:15 2015 TUN/TAP device tun0 opened
Sat Jun 27 13:26:15 2015 TUN/TAP TX queue length set to 100
Sat Jun 27 13:26:15 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sat Jun 27 13:26:15 2015 /sbin/ip link set dev tun0 up mtu 1500
Sat Jun 27 13:26:15 2015 /sbin/ip addr add dev tun0 local 192.168.11.6 peer 192.168.11.5
Sat Jun 27 13:26:15 2015 /sbin/ip route add 192.168.10.0/24 via 192.168.11.5
Sat Jun 27 13:26:15 2015 GID set to nogroup
Sat Jun 27 13:26:15 2015 UID set to nobody
Sat Jun 27 13:26:15 2015 Initialization Sequence Completed
^CSat Jun 27 13:28:17 2015 event_wait : Interrupted system call (code=4)
Sat Jun 27 13:28:17 2015 /sbin/ip route del 192.168.11.1/32
RTNETLINK answers: Operation not permitted
Sat Jun 27 13:28:17 2015 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jun 27 13:28:17 2015 /sbin/ip route del 192.168.51.0/24
RTNETLINK answers: Operation not permitted
Sat Jun 27 13:28:17 2015 ERROR: Linux route delete command failed: external program exited with error status: 2
Sat Jun 27 13:28:17 2015 Closing TUN/TAP interface
Sat Jun 27 13:28:17 2015 /sbin/ip addr del dev tun0 local 192.168.11.6 peer 192.168.11.5
RTNETLINK answers: Operation not permitted
Sat Jun 27 13:28:17 2015 Linux ip addr del failed: external program exited with error status: 2
Sat Jun 27 13:28:17 2015 SIGINT[hard,] received, process exiting

불행하게도 openvpn을 서비스로 시작하면 터널이 열리지 않거나 내가 볼 수 있는 어떤 작업도 수행되지 않는 것 같습니다...

~# systemctl start openvpn.service
~# systemctl status openvpn.service
● openvpn.service - OpenVPN service
   Loaded: loaded (/lib/systemd/system/openvpn.service; enabled)
   Active: active (exited) since Sat 2015-06-27 13:29:12 EDT; 4min 3s ago
  Process: 13873 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 13873 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/openvpn.service

터널은 전혀 나타나지 않는 것 같아서 "기존" 방법도 시도해 보았습니다.

~# /etc/init.d/openvpn start
[ ok ] Starting openvpn (via systemctl): openvpn.service.
~# /etc/init.d/openvpn status
● openvpn.service - OpenVPN service
   Loaded: loaded (/lib/systemd/system/openvpn.service; enabled)
   Active: active (exited) since Sat 2015-06-27 13:09:12 EDT; 8min ago
  Process: 13873 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 13873 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/openvpn.service

그러나 어쨌든 SysV init 스크립트는 systemctrl을 호출하는 것 같습니다.

OpenVPN에 대한 Debian 위키 페이지를 살펴보았는데 서비스로 실행될 때 *.conf/etc/openvpn의 모든 파일을 구문 분석하고 /etc/default/openvpn.

내 다음 단계가 무엇인지 잘 모르겠습니다.

답변1

~처럼내가 전에 말했잖아:

systemd가 서비스를 제어하는 ​​방법에 대해 새로운 내용이 누락된 것 같습니다.

예, 상단 댓글에 설명되어 있습니다 /lib/systemd/system/openvpn.service. 다른 질문자와 마찬가지로 rc시스템 5 스크립트를 호출하여 시스템 5를 직접 호출하고 있습니다. rcSystem 5 스크립트, 특히 System 5 시스템의 스크립트를 직접 호출 하지 마십시오 rc. 특히 사용하지 않는 경우에는 더욱 그렇습니다., Debian 버전 8 등.

OpenVPN은 Fedora, Ubuntu, Debian Linux 등 systemd의 템플릿 서비스입니다. 이러한 서비스에는 이름이 지정되어 있으므로 인스턴스를 시작해야 합니다.openvpn@config.service/etc/openvpn/servervpn.conf

시스템 제어 시작[이메일 보호됨]

추가 읽기

답변2

uml-utilities 패키지를 설치해야 합니다.

관련 정보