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 tailscaled with --state=mem: for a throwaway node

Network and access
~/tips/tip-tailscale-ephemeral-mem

tailscaled --state=mem:

Starts a Tailscale node that keeps no state on disk and is removed from the tailnet when done.

Containers that join a tailnet and never leave fill the admin console with dead entries.

There are two ways to make a node ephemeral. One is an ephemeral auth key from the admin console. The other, from Tailscale 1.22, needs no key at all:

tailscaled --state=mem:

State is kept in memory instead of on disk, and the node registers as ephemeral. On 1.30 or later the daemon logs out by itself when it exits. Otherwise an ephemeral node disappears from the tailnet roughly 30 to 60 minutes after its last activity. Run tailscale logout in a job’s last step and it goes right away.

That fits CI runners and short-lived containers. If you run several copies of one container, the docs recommend a reusable auth key over baking a node key into the image, so you do not end up with duplicate devices.

Caveat: because nothing is stored, the node is a stranger every time it starts. Do not use this for something you reach by a name you rely on, like a long-running service.

My opinion: it beats cleaning up stale devices by hand. A tailnet with only live machines in it is much easier to read.

Further reading: Ephemeral nodes, On this site: tailscale ping tells you if a device is reached directly or through a relay, On this site: send a file to your phone with tailscale file cp, no cloud in between

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