client
proto udp
explicit-exit-notify
remote PUBLIC_IP 1194
dev tun
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_2CAzflUWmRFturMk name
auth SHA256
auth-nocache
cipher AES-128-GCM
tls-client
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
ignore-unknown-option block-outside-dns
setenv opt block-outside-dns # Prevent Windows 10 DNS leak
verb 3
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
-----BEGIN ENCRYPTED PRIVATE KEY-----
-----END ENCRYPTED PRIVATE KEY-----
<tls-crypt>
# 2048 bit OpenVPN static key
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
</tls-crypt>
这个
server.conf
port 1194
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 1.0.0.1"
push "dhcp-option DNS 1.1.1.1"
push "redirect-gateway def1 bypass-dhcp"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key 0
crl-verify crl.pem
ca ca.crt
cert server_2CAzflUWmRFturMk.crt
key server_2CAzflUWmRFturMk.key
auth SHA256
cipher AES-128-GCM
ncp-ciphers AES-128-GCM
tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
client-config-dir /etc/openvpn/ccd
status /var/log/openvpn/status.log
log /var/log/openvpn.log
verb 3
ufw防火墙被禁用,并且已经通过
this
脚本生成了openvpn客户端文件(但尝试了许多不同的方法)。
客户端挂起“等待服务器响应”,服务器记录如下:
openvpn.log
Thu Jun 25 11:50:29 2020 OpenVPN 2.4.4 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on May 14 2019
Thu Jun 25 11:50:29 2020 library versions: OpenSSL 1.1.1 11 Sep 2018, LZO 2.08
Thu Jun 25 11:50:29 2020 ECDH curve prime256v1 added
Thu Jun 25 11:50:29 2020 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Thu Jun 25 11:50:29 2020 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Thu Jun 25 11:50:29 2020 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Thu Jun 25 11:50:29 2020 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Thu Jun 25 11:50:29 2020 TUN/TAP device tun0 opened
Thu Jun 25 11:50:29 2020 TUN/TAP TX queue length set to 100
Thu Jun 25 11:50:29 2020 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Thu Jun 25 11:50:29 2020 /sbin/ip link set dev tun0 up mtu 1500
Thu Jun 25 11:50:29 2020 /sbin/ip addr add dev tun0 10.8.0.1/24 broadcast 10.8.0.255
Thu Jun 25 11:50:29 2020 Could not determine IPv4/IPv6 protocol. Using AF_INET
Thu Jun 25 11:50:29 2020 Socket Buffers: R=[212992->212992] S=[212992->212992]
Thu Jun 25 11:50:29 2020 UDPv4 link local (bound): [AF_INET][undef]:1194
Thu Jun 25 11:50:29 2020 UDPv4 link remote: [AF_UNSPEC]
Thu Jun 25 11:50:29 2020 GID set to nogroup
Thu Jun 25 11:50:29 2020 UID set to nobody
Thu Jun 25 11:50:29 2020 MULTI: multi_init called, r=256 v=256
Thu Jun 25 11:50:29 2020 IFCONFIG POOL: base=10.8.0.2 size=252, ipv6=0
Thu Jun 25 11:50:29 2020 IFCONFIG POOL LIST
Thu Jun 25 11:50:29 2020 Initialization Sequence Completed