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