使用https://github.com/angristan/openvpn-install我已经在 AWS Lightsail 实例(Ubuntu 18.04 LTS)上安装了 openvpn。我的服务器配置文件如下:
port 33434
proto udp
dev tun
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "redirect-gateway def1 bypass-dhcp"
dh dh.pem
tls-auth tls-auth.key 0
crl-verify crl.pem
ca ca.crt
cert server_VYtknmf1PC80WpTG.crt
key server_VYtknmf1PC80WpTG.key
auth SHA512
cipher AES-256-CBC
ncp-ciphers AES-256-CBC
tls-server
client-config-dir /etc/openvpn/ccd
status /var/log/openvpn/status.log
verb 3
我的client.ovpn如下:
client
proto udp
explicit-exit-notify
remote 35.173.69.115 33434
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_VYtknmf1PC80WpTG name
auth SHA512
auth-nocache
cipher AES-256-CBC
tls-client
setenv opt block-outside-dns # Prevent Windows 10 DNS leak
verb 3
我已经在 AWS 实例的防火墙规则中添加了端口“33434”UDP。
我在华硕路由器的 VPN 客户端部分添加了一个新配置文件,并上传了 client.ovpn 文件。然后单击“激活”,并在日志中获取后续消息。
May 15 22:29:43 vpnclient1[17419]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
May 15 22:29:43 vpnclient1[17419]: Socket Buffers: R=[122880->122880] S=[122880->122880]
May 15 22:29:43 vpnclient1[17419]: UDPv4 link local: [undef]
May 15 22:29:43 vpnclient1[17419]: UDPv4 link remote: [AF_INET]35.173.69.115:33434
May 15 22:29:43 vpnclient1[17419]: TLS: Initial packet from [AF_INET]35.173.69.115:33434, sid=61d9df2d 1f97bdd0
May 15 22:30:02 rc_service: service 17718:notify_rc restart_letsencrypt
May 15 22:30:43 vpnclient1[17419]: TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
May 15 22:30:43 vpnclient1[17419]: TLS Error: TLS handshake failed
May 15 22:30:43 vpnclient1[17419]: SIGUSR1[soft,tls-error] received, process restarting
May 15 22:30:43 vpnclient1[17419]: Restart pause, 2 second(s)
请建议如何解决该问题。谢谢。