我的问题是我无法连接到我的 OpenVPN 服务器。我总是收到“TLS 密钥协商在 60 秒内失败(请检查您的网络连接)”错误。尝试连接我服务器上的 1194 端口时运行 tcpdump 显示有 4 个来自我 PC 的数据包。
我的 server.conf 在 /etc/openvpn/server 中:
# OpenVPN Port, Protocol, and the Tun
port 1194
proto udp
dev tun
#listen
local *my DNS*
# OpenVPN Server Certificate - CA, server key and certificate
ca /etc/openvpn/server/ca.crt
cert /etc/openvpn/server/*cert*.crt
key /etc/openvpn/server/*key*.key
#DH and CRL key
dh /etc/openvpn/server/dh.pem
crl-verify /etc/openvpn/server/crl.pem
# Network Configuration - Internal network
# Redirect all Connection through OpenVPN Server
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1"
# Using the DNS from https://dns.watch
push "dhcp-option DNS 84.200.69.80"
push "dhcp-option DNS 84.200.70.40"
#Enable multiple clients to connect with the same certificate key
duplicate-cn
# TLS Security
cipher AES-256-CBC
tls-version-min 1.0
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-128-CBC-SHA256
auth SHA512
auth-nocache
# Other Configuration
keepalive 20 60
persist-key
persist-tun
compress lz4
daemon
user nobody
group nobody
# OpenVPN Log
log-append /var/log/openvpn.log
verb 4
我的 Windows 客户端上的 client.ovpn:
client
dev tun
proto udp
remote *my DNS* 1194
ca "c:\\Users\\*Username*\\Documents\\OpenVPNFiles\\Client1\\client\\ca.crt"
cert "c:\\Users\\*Username*\\Documents\\OpenVPNFiles\\Client1\\client\\*cert*.crt"
key "c:\\Users\\*Username*\\Documents\\OpenVPNFiles\\Client1\\client\\*key*.key"
cipher AES-256-CBC
auth SHA512
auth-nocache
tls-version-min 1.0
tls-cipher TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256:TLS-DHE-RSA-WITH-AES-128-GCM-SHA256:TLS-DHE-RSA-WITH-AES-128-CBC-SHA256
remote-cert-tls server
resolv-retry infinite
compress lz4
nobind
persist-key
persist-tun
mute-replay-warnings
verb 4
非常感谢您的帮助。
答案1
所以,我自己修复了这个问题。问题是 server..conf 文件位于 /etc/oopnvpn/server 中,而不是 /etc/openvpn 中。