I can connect to my server just fine, but if I close the connection as the client with ctrl+C in the terminal, I struggle to log back in. I think I need to prevent the attempts at reconnecting, and let it sit for several minutes, before being allowed back in... Could anyone help me reconnect sooner?
My reconnection attempt hangs there:
2022-06-01 21:00:01 TCP/UDP: Preserving recently used remote address: [AF_INET](My server's IP)
2022-06-01 21:00:01 Socket Buffers: R=[212992->212992] S=[212992->212992]
2022-06-01 21:00:01 UDP link local: (not bound)
2022-06-01 21:00:01 UDP link remote: [AF_INET](My server's IP)
and fails to do the TLS handshake.
On the server, I edited /etc/openvpn/server.conf
I changed keepalive to 3 6 and I tried keepalive 0 0 as well. I saw no difference.
In the client config file, I tried commenting and uncommenting ...
revolv-retry infinite
persist-key
persist-tun
and added keepalive 0 0
with no apparent effect.
And, I start my client service with sudo openvpn --config client.conf
My client .conf file
client.conf
client
proto udp
explicit-exit-notify
remote (IP & port)
dev tun
keepalive 0 0
resolv-retry infinite
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_ttyDKQdxWqAPaHP4 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
<ca>
And server file at /etc/openvpn/server.conf
server.conf
port (port)
proto udp
dev tun
user nobody
group nogroup
persist-key
persist-tun
keepalive 0 0
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 94.140.14.14"
push "dhcp-option DNS 94.140.15.15"
push "redirect-gateway def1 bypass-dhcp"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key
crl-verify crl.pem
ca ca.crt
cert server_ttyDKQdxWqAPaHP4.crt
key server_ttyDKQdxWqAPaHP4.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
verb 3
Edit
I noticed that on the client side, my tunnel is tun14 ... it means it keeps track of all the successful connections I have made.
I tried disabling it and removing it, successfully, but all it did was kill the connection, and I still had to wait 5-10 minutes to log back in.
I also tried lowering the keepalive in /etc/sysctl.conf on both server and client as shown here https://webhostinggeeks.com/howto/confi ... e-setting/ but that also changed nothing. I am thinking that keepalives might not be related to my long reconnection delay.