adjust vpn config, adjust retry config

This commit is contained in:
2024-09-12 19:59:25 -05:00
parent 5b0c2c9038
commit 00d63eebd6
3 changed files with 5 additions and 10 deletions

View File

@@ -170,7 +170,6 @@ for index, server in enumerate(servers):
print(f"{datetime.datetime.now()} [{index+1}/{server_count}] [{server_name}]: VPN connection failed to establish.") print(f"{datetime.datetime.now()} [{index+1}/{server_count}] [{server_name}]: VPN connection failed to establish.")
else: else:
print(f"{datetime.datetime.now()} [{index+1}/{server_count}] [{server_name}]: Error starting OpenVPN connection: {connection_message}") print(f"{datetime.datetime.now()} [{index+1}/{server_count}] [{server_name}]: Error starting OpenVPN connection: {connection_message}")
# Disconnect VPN # Disconnect VPN
disconnect_vpn() disconnect_vpn()
print(f"{datetime.datetime.now()} [{index+1}/{server_count}] [{server_name}]: VPN disconnected.") print(f"{datetime.datetime.now()} [{index+1}/{server_count}] [{server_name}]: VPN disconnected.")

View File

@@ -17,8 +17,7 @@ def establish_vpn_connection(ovpn_file, credential_file, log_file, debug_print=N
# Establish VPN connection (capture stdout and stderr) # Establish VPN connection (capture stdout and stderr)
openvpn_command = ["/usr/sbin/openvpn", "--config", ovpn_file, openvpn_command = ["/usr/sbin/openvpn", "--config", ovpn_file,
"--auth-user-pass", credential_file, "--auth-user-pass", credential_file, "--verb", "1"]
"--verb", "1"]
if debug_print: if debug_print:
debug_print(f"OpenVPN command: {' '.join(openvpn_command)}") # Debug print debug_print(f"OpenVPN command: {' '.join(openvpn_command)}") # Debug print

View File

@@ -4,7 +4,7 @@ client
dev tun dev tun
proto tcp proto tcp
remote {server_ip} 443 remote {server_ip} 443
resolv-retry infinite resolv-retry 3
remote-random remote-random
nobind nobind
tun-mtu 1500 tun-mtu 1500
@@ -12,9 +12,7 @@ tun-mtu-extra 32
mssfix 1450 mssfix 1450
persist-key persist-key
persist-tun persist-tun
ping 15 connect-retry-max 1
ping-restart 0
ping-timer-rem
reneg-sec 0 reneg-sec 0
comp-lzo no comp-lzo no
verify-x509-name CN={server_cn} verify-x509-name CN={server_cn}
@@ -22,7 +20,6 @@ remote-cert-tls server
auth-user-pass auth-user-pass
verb 3 verb 3
pull pull
fast-io
cipher AES-256-CBC cipher AES-256-CBC
auth SHA512 auth SHA512
<ca> <ca>