Skip to content

Knoten v0.3.2-alpha

Pre-release
Pre-release

Choose a tag to compare

@Yacin1102 Yacin1102 released this 09 Nov 18:11
· 2 commits to main since this release

Self-assigned IPv6 addresses, in-memory coordination server

The coordination server no longer hands out addresses. Every machine works out its own IPv6 address from its mesh name, its subnet and its public key. The server is now a small in-memory service with no database. Several meshes can share one server, subnets decide which peers a machine accepts, and a new only mark limits the tunnel to the peers you choose.

New

IPv6 addresses each machine computes itself

  • Each address is built from three parts: the mesh name, the subnet and the public key.
  • Any machine can compute any peer's address from that peer's key and subnet. The server is not involved.
  • meshd logs the machine's address at startup, and meshd -setup prints it at the end.

Meshes

  • New required setting mesh. Machines in the same mesh share the first 48 bits of their addresses.
  • Several meshes can use the same coordination server: a machine ignores peers from any other mesh.

Subnets

  • New setting subnet: this machine's subnet. Setup uses global if you skip the question.
  • New setting accept_subnets: the subnets whose peers this machine uses. ["*"] accepts all of them, and leaving it empty accepts only the machine's own subnet.
  • Peers whose subnet isn't accepted are left out of the tunnel, and the log says so.

"only": true on peers

  • Put it on any static or synced peer. While at least one peer is marked, the tunnel contains only the marked peers. Every other peer stays in the file but out of the tunnel, and that includes new ones from the server.
  • Only you can set or clear the mark. The server can't. meshd keeps it on synced peers across server updates.
  • If the server drops a marked synced peer, its line and its mark go with it, and once no marked peer is left, every peer is back in the tunnel. For a limit that can't lift on its own, mark a static peer.
  • A blocked peer can't be marked.

synced peers work without a server

  • Without server_url, synced peers are now used as written instead of being ignored. Nothing updates them, so edits to their lines take effect.

Coordination server rebuilt, in memory

  • No database and no files. A restart loses nothing, because machines announce themselves again on their next sync.
  • A machine's first sync is how it joins. There is no separate registration step.
  • A machine that stays silent longer than -peer-timeout (default 90s) is dropped.

Changed

  • Setup asks for the mesh name and this machine's subnet instead of an IPv4 address. For each peer it asks for the subnet instead of AllowedIPs.
  • mtu must now be at least 1280, the IPv6 minimum.
  • Peers in meshd.json have a subnet instead of allowed_ips.

Removed

  • The address setting and the server-assigned IPv4 range 10.10.0.0/16.
  • The allowed_ips field on peers.
  • The /v1/register, /v1/sync and /v1/health endpoints. The only endpoint now is /v2/sync.
  • The coordserver -db flag and the SQLite database. This also removes modernc.org/sqlite.