ekristen / docker-openvpn-client

OpenVPN Client for Docker
42 stars 40 forks source link

Unable to reconnect -- RESOLVE: Cannot resolve host address: [HOST]: Try again #5

Open Hossy opened 6 years ago

Hossy commented 6 years ago

I noticed the following today that the OpenVPN client was unable to reconnect when the session timed out. The the inactivity timeout occurred and the VPN connection was lost, the routes did not revert and still appear as though the VPN connection is established, which explains why it can't reconnect.

I would MUCH prefer that only the OpenVPN process have Internet connectivity when the VPN is disconnected, but it seems the routes definitely need to be reset/cleared after a timeout/disconnect in order to restore connectivity for a DNS lookup and reconnection.

Alternative: Kill the container when OpenVPN disconnects/terminates and let Docker restart it?

I found a similar issue with dperson's image and I'm wondering if the same might apply? https://github.com/dperson/openvpn-client/issues/13

Logs: Mon Jan 22 23:04:32 2018 [7b937c1bc334ae9eeb9c670627a246da] Inactivity timeout (--ping-restart), restarting Mon Jan 22 23:04:32 2018 SIGUSR1[soft,ping-restart] received, process restarting Mon Jan 22 23:04:34 2018 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts Mon Jan 22 23:04:39 2018 RESOLVE: Cannot resolve host address: [HOST]: Try again

*** It has been scrolling the last line in the logs every 10 seconds since then.

sliddjur commented 5 years ago

Are you pushing a DNS server to the client, that exists over the VPN tunnel?