I have two OpenVPN servers listening on two different ports. The first one, which the client should try to connect to, is listening on default port 1194 UDP. The second one, used if networks have firewall, is listening on port 443 via TCP.
How to configure the client file correctly if:
- The client should try the faster 1194 UDP-server first and
- if the port 1194 is blocked switch to server 2 with port 443 over TCP after 5 seconds.
Currently I've added the following two lines to my client config, but the client only switches to server 2 after 2 minutes with error
TCP: connect to [AF_INET]SERVERIP:1194 failed: Unknown error
and then connects perfectly to the second server. But this should not take so long ...
My current lines in the config:
remote serverip1 1194
remote serverip2 443
keepalive 2 6
resolv-retry 2
How to make this timeout shorter?