I have a windows remote client with OpenVPN Connect 3.4.4.
It is automatically started via "ovpnconnector" service at the system boot and tries to connect over the internet to my local openvpn server (on slackware linux, openvpn version 2.5.5).
My server has a dynamic IP, so I set up a domain name by a DDNS service (mydomain.example.net in below example).
Here my client config:
If the server is running and its IP is properly resolved using the domain name, the VPN is established and all works fine.
I noticed a problem in the case my server domain name changes.
My server is not always on, I run it when I need to reach remote client. So, the client rests always on and continues trying to connect to server, while this one could be in an on or off state.
If I reach the client in some way (I tried using teamviewr for instance), I can read some log of "ovpnconnector.log", and here what is happening:
The client tries to connect to the old IP assigned to my domain name. Instead it should renew the name resolution by contact system DNS before "EVENT:RECONNECTING".
I noticed there is an "EVENT:RESOLVE" in the log file, but it happens just once when ovpnconnector service is started, at system boot.
This behavior left my client in a "limbo" status of retrying again and again to reach an IP that no longer provides any vpn service.
If I try to launch a "ping mydomain.example.net" from the client, it contacts my actual IP 5.6.7.8. So, at operative system level, windows can resolve properly my domain name with the right new IP address, while ovpnconnector doesn't seem to update it. I suspect it depends on a missing "EVENT: RESOLVE" when it retries to reconnect to the server.
Is there something I can do to solve this issue, for instance by add some option in client config file?
Thanks in advance!
It is automatically started via "ovpnconnector" service at the system boot and tries to connect over the internet to my local openvpn server (on slackware linux, openvpn version 2.5.5).
My server has a dynamic IP, so I set up a domain name by a DDNS service (mydomain.example.net in below example).
Here my client config:
Code:
client dev tun proto udp remote mydomain.example.net 12345 ping 10 ping-restart 10 nobind ecdh-curve secp521r1 remote-cert-tls server verb 3
I noticed a problem in the case my server domain name changes.
My server is not always on, I run it when I need to reach remote client. So, the client rests always on and continues trying to connect to server, while this one could be in an on or off state.
- Let's say on the first successful connection "mydomain.example.net" was 1.2.3.4, the client started and resolved the remote name properly, connected and VPN worked OK.
- When I turn off the server, VPN connection goes down.
- The client is again ON ant continue to re-try establishing vpn connection, again and again.
- On server side I turn OFF my router, and turn it on again, so that my ISP assigns an other IP: let's say 5.6.7.8.
- On server side system a ddns service updates the IP of domain name and "mydomain.example.net" points now to 5.6.7.8.
- OK, now I want to connect to remote client.
- So I launch openvpn on the server, and expect the client contacts me at mydomain.example.net (5.6.7.8).
- But something doesn't work.
If I reach the client in some way (I tried using teamviewr for instance), I can read some log of "ovpnconnector.log", and here what is happening:
Code:
Wed May 15 13:31:01 2024 EVENT: RECONNECTING Wed May 15 13:31:01 2024 Contacting 1.2.3.4:12345 via UDP Wed May 15 13:31:01 2024 EVENT: WAIT Wed May 15 13:31:01 2024 Connecting to [mydomain.example.net]:12345 (1.2.3.4) via UDP Wed May 15 13:31:11 2024 Server poll timeout, trying next remote entry... Wed May 15 13:31:11 2024 EVENT: RECONNECTING Wed May 15 13:31:11 2024 Contacting 1.2.3.4:12345 via UDP Wed May 15 13:31:11 2024 EVENT: WAIT Wed May 15 13:31:11 2024 Connecting to [mydomain.example.net]:12345 (1.2.3.4) via UDP Wed May 15 13:31:21 2024 Server poll timeout, trying next remote entry...
I noticed there is an "EVENT:RESOLVE" in the log file, but it happens just once when ovpnconnector service is started, at system boot.
This behavior left my client in a "limbo" status of retrying again and again to reach an IP that no longer provides any vpn service.
If I try to launch a "ping mydomain.example.net" from the client, it contacts my actual IP 5.6.7.8. So, at operative system level, windows can resolve properly my domain name with the right new IP address, while ovpnconnector doesn't seem to update it. I suspect it depends on a missing "EVENT: RESOLVE" when it retries to reconnect to the server.
Is there something I can do to solve this issue, for instance by add some option in client config file?
Thanks in advance!
Comment