我的 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