Documentation
¶
Overview ¶
Package lannet answers "what address can peers on the local network reach this host at" — shared by the CLI (QR links) and the daemon's bridge listener.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsCGNAT ¶
IsCGNAT reports whether ip is in 100.64.0.0/10 — the shared-address range Tailscale assigns tailnet devices from. Used to tell a tailnet address apart from a physical LAN one.
func LANIP ¶
LANIP returns a non-loopback IPv4 address other devices on the local network can reach this host at — the address the QR advertises so the phone can connect to the laptop's gateway and Metro.
Primary method is the UDP-dial trick: "connecting" a UDP socket to a public address makes the kernel select the egress interface (no packets are sent), and its local address is the one a peer on that path sees. Falls back to scanning interfaces for a private (RFC1918) IPv4 when the dial can't resolve a usable address (e.g. no default route).
NB: with a VPN/tailscale exit node active, the dial trick returns the tunnel address (e.g. 100.64/10) — callers that need a physical-LAN address should check IsCGNAT.
Types ¶
This section is empty.