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: tailscale set with a relay port turns your own server into a Tailscale relay

Network and access
~/tips/tip-tailscale-peer-relay

sudo tailscale set --relay-server-port=40000

Use your own well-connected node as a relay when devices cannot connect directly.

When two devices cannot reach each other directly, Tailscale relays the traffic through its DERP servers, which can be slow. Peer relays let one of your own nodes do that job instead.

On a machine with a good connection and a UDP port that is reachable, pick a port:

sudo tailscale set --relay-server-port=40000

Then allow devices to use it with a grant in the policy file. The capability takes no parameters:

"grants": [
  {
    "src": ["autogroup:member"],
    "dst": ["tag:relay"],
    "app": { "tailscale.com/cap/relay": [] }
  }
]

Here the relay carries tag:relay. Devices that use it need Tailscale 1.86 or newer, and they must be able to reach that UDP port, so open it in the firewall and forward it on your router if the relay sits at home.

tailscale ping to a peer shows whether traffic now goes through your relay instead of DERP. If no peer relay is available, Tailscale falls back to DERP, so nothing breaks when the relay is down.

To stop relaying, set the port to an empty value with --relay-server-port=. I would pick a box with stable uptime for this, since a relay that reboots often just adds hiccups.

Further reading: Tailscale Peer Relays

Going deeper: 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