brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: run tailscale ping to see if your connection is direct or relayed

Network and access
~/tips/tailscale-ping

tailscale ping my-server

Tells you if a connection on your Tailscale network is direct or goes through a relay.

When something on my tailnet feels slow, I want to know one thing first: is the traffic going straight to the other device, or around the houses through a relay? Plain ping cannot tell you that. tailscale ping can.

You give it a device name or a 100.x.y.z address, and it pings that device over Tailscale only. Tailscale’s docs say it shows more about the connection than the normal ping, which is exactly what you want when you are troubleshooting.

tailscale ping my-server

The docs’ own example prints a few lines like pong from another-device (100.113.160.82) via DERP(nyc) in 37ms and then one that ends in an IP address and port instead. The first pings go through the nearest DERP relay while the two devices negotiate. Once a direct path exists, the line shows the other side’s address and port. That switch is what you are waiting for. If the lines keep saying DERP, you are relayed, and Tailscale says relayed traffic is the fallback for when direct connections fail. It is still end-to-end encrypted, so a relay only costs you speed.

tailscale status gives a second opinion: the docs say a peer line with direct is direct, and one with relay goes through a DERP server.

One caveat: the first pings are allowed to be slow, so do not judge the connection by the first line. By default it stops once a direct path is found. For me in Leiden, this is the first thing I would run before blaming my router or the server.

Further reading: Tailscale CLI (Tailscale docs), Connection types (Tailscale docs), On this site: tailscale ping tells you if a device is reached directly or through a relay, On this site: tailscale netcheck tells you why your connection is not direct, On this site: Why a Tailscale device vanishes after 180 days, and how to stop it

More Network and access tips scp -3 alice@server-a:/var/backups/db.sql.gz bob@server-b:/srv/restore/ tailscale exit-node suggest tailscale lock sign nodekey:1abddef1 tlpub:abcdef12 wg genpsk > peer1.psk Table = off All Network and access tips (163) All topics

Link