docs/gateway/discovery.md
OpenClaw has two distinct problems that look similar on the surface:
The design goal is to keep all network discovery/advertising in the Node Gateway (openclaw gateway) and keep clients (mac app, iOS) as consumers.
127.0.0.1:18789 by default; can be bound to LAN/tailnet via gateway.bind.127.0.0.1:18789 over SSH.Protocol details:
Multicast Bonjour is best-effort and does not cross networks. OpenClaw can also browse the same gateway beacon via a configured wide-area DNS-SD domain, so discovery can cover:
local. on the same LANTarget direction:
bonjour plugin is enabled. The plugin auto-starts on macOS hosts and is
opt-in elsewhere.Troubleshooting and beacon details: Bonjour.
_openclaw-gw._tcp (gateway transport beacon)role=gatewaytransport=gatewaydisplayName=<friendly name> (operator-configured display name)lanHost=<hostname>.localgatewayPort=18789 (Gateway WS + HTTP)gatewayTls=1 (only when TLS is enabled)gatewayTlsSha256=<sha256> (only when TLS is enabled and fingerprint is available)canvasPort=<port> (canvas host port; currently the same as gatewayPort when the canvas host is enabled)tailnetDns=<magicdns> (optional hint; auto-detected when Tailscale is available)sshPort=<port> (mDNS full mode only; wide-area DNS-SD may omit it, in which case SSH defaults stay at 22)cliPath=<path> (mDNS full mode only; wide-area DNS-SD still writes it as a remote-install hint)Security notes:
lanHost, tailnetDns, or gatewayPort.gatewayTlsSha256 to override a previously stored pin.Enable/disable/override:
openclaw plugins enable bonjour enables LAN multicast advertising.OPENCLAW_DISABLE_BONJOUR=1 disables advertising.OPENCLAW_DISABLE_BONJOUR is unset,
Bonjour advertises on normal hosts and auto-disables inside detected containers.
Empty-config macOS Gateway startup enables the plugin automatically; Linux,
Windows, and containerized deployments need explicit enablement.
Use 0 only on host, macvlan, or another mDNS-capable network; use 1 to
force-disable.gateway.bind in ~/.openclaw/openclaw.json controls the Gateway bind mode.OPENCLAW_SSH_PORT overrides the SSH port advertised when sshPort is emitted.OPENCLAW_TAILNET_DNS publishes a tailnetDns hint (MagicDNS).OPENCLAW_CLI_PATH overrides the advertised CLI path.For London/Vienna style setups, Bonjour won’t help. The recommended “direct” target is:
If the gateway can detect it is running under Tailscale, it publishes tailnetDns as an optional hint for clients (including wide-area beacons).
The macOS app now prefers MagicDNS names over raw Tailscale IPs for gateway discovery. This improves reliability when tailnet IPs change (for example after node restarts or CGNAT reassignment), because MagicDNS names resolve to the current IP automatically.
For mobile node pairing, discovery hints do not relax transport security on tailnet/public routes:
wss:// or Tailscale Serve/Funnel).ws://.ws:// remains supported.When there is no direct route (or direct is disabled), clients can always connect via SSH by forwarding the loopback gateway port.
See Remote access.
Recommended client behavior:
local. or the configured wide-area domain, offer a one-tap “Use this gateway” choice and save it as the direct endpoint.ws://.The gateway is the source of truth for node/client admission.