Keepalive question

I am using Tailscale (TS) to connect two networks to transmit, every night, backup data to an offsite machine. TS does a great job, both networks can operate with no public, open ports and speed is great. But… sometimes I don’t get a direct connection and run in DERP or Relay mode. In my case this is significantly slower, by a factor of 7 to 1.

I find if I persist and use lots of retries, like tailscale ping --c 100 <node> I can get a direct connection. I am thinking to run a script repeatedly to perform this to ensure that when it’s time for backup the connection will be direct.
My question is:
How long does the connection stay up without any activity? 60 seconds? 5 minutes? 60 minutes? If I know I can plan my keep alive job to repeat before I loose the connection.


Old post, but stumbled upon it for the same reason you wrote it… I did some brief testing and it appears that a single ping will keep the TS connection alive for just under a minute… Somewhere between 40-50 secs.

FWIW, the tailscale ping method does not make the connection go active for me… Only an actual ping does. YMMV.

Thank you. I will consider using this. But I did resolve my performance problem using a different technique.

Read this post