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: the ip field in a Tailscale grant limits access to the ports you name

Network and access
~/tips/tip-tailscale-grants-ports

"grants": [

Allow only the protocols and ports a service needs instead of the whole device.

It is tempting to write "ip": ["*"] everywhere. That gives the whole device: SSH, admin panels, everything that listens. Usually the other side only needs one or two ports.

"grants": [
  {
    "src": ["group:family"],
    "dst": ["tag:dns"],
    "ip": ["tcp:53", "udp:53"]
  },
  {
    "src": ["group:family"],
    "dst": ["tag:media"],
    "ip": ["tcp:443"]
  }
]

The family can ask the DNS server questions and open the media server over HTTPS, and nothing else on those machines. The docs say the field takes specific ports, port ranges or whole protocols.

I’d always write the tcp: or udp: prefix, so the rule says exactly what I mean and nobody has to guess later.

To check a rule before saving, add a tests block to the policy file with an accept and a deny case for that port. A test that fails stops the save, which is better than finding out from a confused family member.

Grants and the older acls section can live side by side in one file. Tailscale recommends grants for new rules.

Further reading: Grants, Tailnet policy file syntax

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