gsliepen / tinc

a VPN daemon
http://tinc-vpn.org/
Other
1.91k stars 280 forks source link

Tinc stops working properly after waking up from hibernation #224

Open zingmars opened 5 years ago

zingmars commented 5 years ago

On Windows 10 v1903 using Tinc1.1pre17 and the TAP drivers shipped with this version.

After waking up from hibernation tinc reconnects, but I'm unable to either ping or connect to any device connected (connection timed out). What's weirder, when I try to restart or turn tinc off, it will no longer terminate nicely and I have to terminate the process. Here's a log with -d3:

Trying to connect to server (SERVERIP port 655)
Timeout while connecting to server (SERVERIP port 655)
Closing connection with server (SERVERIP port 655)
Could not set up a meta connection to server
Trying to re-establish outgoing connection in 5 seconds
Trying to connect to server (SERVERIP port 655)
Connected to server (SERVERIP port 655)
Connection with server (SERVERIP port 655) activated
UDP address of server set to SERVERIP port 655
UDP address of anotherdevice set to MYIP port 655
Autoconnecting to anotherdevice
Trying to connect to anotherdevice (MYIP port 655)
Connected to anotherdevice (MYIP port 655)
Timeout from anotherdevice (MYIP port 655) during authentication
Closing connection with anotherdevice (MYIP port 655)
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 5 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 10 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 15 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 20 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 25 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 30 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 35 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 40 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 45 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 50 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 55 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 60 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 65 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 70 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 75 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 80 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 85 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 90 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 95 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 100 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 105 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 110 seconds
Error while reading from Windows tap device {tap-dev}: (31) A device attached to the system is not functioning.
Awaking from dead after 11363 seconds of sleep
Forcing connection close after sleep time server (SERVERIP port 655)
Closing connection with server (SERVERIP port 655)
Trying to connect to server (SERVERIP port 655)
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 115 seconds
Expiring symmetric keys
Timeout while connecting to server (SERVERIP port 655)
Closing connection with server (SERVERIP port 655)
Trying to connect to server (SERVERIP port 655)
Timeout while connecting to server (SERVERIP port 655)
Closing connection with server (SERVERIP port 655)
Could not set up a meta connection to server
Trying to re-establish outgoing connection in 5 seconds
Trying to connect to server (SERVERIP port 655)
Connected to server (SERVERIP port 655)
Connection with server (SERVERIP port 655) activated
UDP address of server set to SERVERIP port 655
UDP address of anotherdevice set to MYIP port 655
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 120 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 125 seconds
Could not set up a meta connection to anotherdevice
Trying to re-establish outgoing connection in 130 seconds
Got console shutdown request
Closing connection with server (SERVERIP port 655)
Disabling Windows tap device
Got console shutdown request
Got console shutdown request
Got console shutdown request
Got console shutdown request
Got console shutdown request

(Also I have no idea why it won't connect to anotherdevice. It connects just fine after I ping it or attempt to connect to it's address using any software, but if I don't it just keeps trying to connect and failing like this).

At the end the "Console shutdown request" entries are caused by me spamming ctrl+c in the console window trying to stop it. In this state the only way to actually stop Tinc is to either close the console window (not an option if started as a service) or kill its process. The only thing that has changed altely is me setting manual metric values for the tinc interface so that Windows would use a DNS server exposed to the Tinc network, but even then it took a while for this to start happening so I'm not sure if it's related.

fangfufu commented 3 years ago

Do we have the same problem in the stable version of tinc?

zingmars commented 3 years ago

@fangfufu Not sure, haven't tried it since I exclusively use 1.1 because it has many features 1.0 does not. My current "fix" is a scheduled task that fires after waking up that will simply kill tinc and start it again.