![Ubuntu 18.04,Openvpn 未启动,状态为活动(已退出)](https://linux22.com/image/908467/Ubuntu%2018.04%EF%BC%8COpenvpn%20%E6%9C%AA%E5%90%AF%E5%8A%A8%EF%BC%8C%E7%8A%B6%E6%80%81%E4%B8%BA%E6%B4%BB%E5%8A%A8%EF%BC%88%E5%B7%B2%E9%80%80%E5%87%BA%EF%BC%89.png)
我的 OpenVPN 一直运行良好,直到昨天,当客户端连接到 MiniDLNA 并进行扫描时,它卡住了。OpenVPN 状态返回:
● openvpn.service - OpenVPN service
Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor preset: enabled)
Active: active (exited) since Wed 2019-01-30 10:45:42 UTC; 10min ago
Main PID: 598 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4700)
CGroup: /system.slice/openvpn.service
Jan 30 10:45:42 rock64 systemd[1]: Starting OpenVPN service...
Jan 30 10:45:42 rock64 systemd[1]: Started OpenVPN service.
服务器和客户端配置如下:
Server.conf:
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
push "redirect-gateway
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
duplicate-cn
keepalive 10 120
cipher AES-256-CBC
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
verb 3
explicit-exit-notify 1
Client.conf:
client
dev tun
proto udp
remote xx.dns.xx 1194
nobind
user nobody
group nogroup
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-CBC
verb 3
我能做些什么来解决这个问题?如果有人能告诉我一个可以将我的完整配置(Ubuntu+Openvpn+ufw+Samba 等)从 eMMC 备份到硬盘或 USB 驱动器的步骤,我将不胜感激。
提前致谢。
答案1
好吧,原来是 DNS 服务 (duckdns) 没有更新我的公共地址。这就是我的客户端无法连接的原因。感谢 heynnema 的帮助。
答案2
就我而言,这是因为我重新安装了 openvpn 后,系统脚本指向了错误的路径:
$which open
/usr/local/sbin/openvpn
$/etc/init.d/openvpn point to the wrong path:
/usr/sbin/openvpn