Repository navigation
Releases
Knoten v0.3.2-alpha
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.
meshdlogs the machine's address at startup, andmeshd -setupprints 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 usesglobalif 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
staticorsyncedpeer. 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.
meshdkeeps it onsyncedpeers across server updates. - If the server drops a marked
syncedpeer, 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 astaticpeer. - A
blockedpeer can't be marked.
synced peers work without a server
- Without
server_url,syncedpeers 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.
mtumust now be at least1280, the IPv6 minimum.- Peers in
meshd.jsonhave asubnetinstead ofallowed_ips.
Removed
- The
addresssetting and the server-assigned IPv4 range10.10.0.0/16. - The
allowed_ipsfield on peers. - The
/v1/register,/v1/syncand/v1/healthendpoints. The only endpoint now is/v2/sync. - The coordserver
-dbflag and the SQLite database. This also removesmodernc.org/sqlite.
Knoten_0.3.1-alpha
One config file, with peer memory
meshd now keeps everything in /etc/knoten/meshd.json: settings, private key, VPN address and peers. The state file is gone, and there are no more standalone and coordinated modes.
Peers from the coordination server are saved in that file, so after a restart the tunnel comes back with them, even if the server is down.
A coordination server is used when server_url is set. Peers you add yourself work with or without one.
Each peer has a source:
static: added by you,meshdnever touches itsynced: from the server, kept up to date bymeshdblocked: never added to the tunnel, even if the server sends it
Each public key can only appear once. To keep a server peer, change it to static. To drop it, change it to blocked.
meshd checks the file every 5 seconds and applies your edits without a restart. Only changes to server_url, join_token, token_file, mtu and private_key need one. If the file has a mistake, meshd logs it, keeps running with the last working settings and doesn't write to the file until you fix it.
Other changes
-setupnow creates the key and prints the public key, so-setup -forcegives the machine a new identity.- Setup no longer asks whether to use a server. Leave the URL empty to run without one. You can add peers by hand either way.
-show-keyreads the key frommeshd.json.-print-default-configis gone. The README explains every field.- Unknown fields and duplicate keys in
meshd.jsonare now errors.
Knoten_with_embedded_WireGuard
WireGuard now runs inside meshd
meshd no longer writes a WireGuard config file and shells out to wg and wg-quick. It now embeds wireguard-go and runs the tunnel itself, creating the knoten-wg interface through /dev/net/tun and netlink.
- No WireGuard install needed. The kernel module and
wireguard-toolsare no longer required on nodes. - Live, minimal updates. Each sync compares the new peer list with what the tunnel already has and sends only the difference. The log shows what changed:
synced knoten-wg: 2 added, 0 updated, 0 removed. wg showstill works.meshdopens the standard control socket at/var/run/wireguard/knoten-wg.sock, sosudo wg show knoten-wgworks if you havewireguard-toolsinstalled.- Self-healing tunnel. If the interface or its socket is removed while
meshdruns,meshdcreates it again (coordinated mode).
Behavior changes
- The tunnel lives as long as
meshd. Stoppingmeshdremoves the tunnel; starting it brings it back. Runmeshdas a service (for example systemd withRestart=always). - Standalone mode keeps running. It used to write the config and exit; it now brings the tunnel up and stays running. Restart
meshdafter editing the peer list. -setuponly writes the config. It no longer performs a register-and-sync cycle. Startmeshdafterwards.-oncewas removed.SIGINT/SIGTERMremove the tunnel. Before, they left it up.- New addresses start at
10.10.0.3. The coordination server now keeps the first two addresses of the range back. Machines that are already enrolled keep their address.
Upgrading from v0.2.0-alpha
- Your identity is kept. Existing configs already point to
/var/lib/knoten/meshd-state.jsonthroughstate_path. Only new setups use the new default path,/var/lib/knoten/meshd-State_file.json. /etc/wireguard/knoten-wg.confis no longer used. Bring the old tunnel down once (sudo wg-quick down knoten-wg), then delete the file.mtuis now a number. If you set it by hand as a string ("mtu": "1420"), change it to"mtu": 1420.dnsis no longer used and is ignored.
Under the hood
- Addresses, ranges and endpoints are parsed with
net/netip, for stricter validation in setup, the config and the coordination server. - New dependencies:
golang.zx2c4.com/wireguardandgithub.com/vishvananda/netlink. Both binaries are still static Go builds.
Known limitation
meshd does not remember its peers yet. Every restart builds the tunnel with no peers until the next successful sync. If the coordination server is unreachable at that moment, the node stays cut off until it comes back. The next release adds peer memory and merges standalone and coordinated mode into one configuration file.
knoten_first_release
v0.2.0-alpha
First working release of Knoten, a mesh VPN that creates direct, peer-to-peer WireGuard tunnels.
What's included
Coordination server (coordserver)
- Machine registration with automatic VPN address assignment from
10.10.0.0/16 - Peer sync endpoint, nodes poll for the latest peer list on a configurable interval
- Health endpoint (
/v1/health) reporting machine count, uptime, and fleet status - Join token authentication with constant-time comparison
- Pure-Go SQLite storage (WAL mode,
synchronous = FULL) - Defensive HTTP layer: bounded request bodies, strict JSON decoding, request timeouts, panic recovery
Node daemon (meshd)
- Automatic X25519 key generation via
crypto/ecdh— private keys never leave the machine - Register → sync → render → apply loop with live
wg syncconfupdates (zero tunnel downtime) - Exponential backoff with jitter (1s → 60s) when the coordination server is unreachable
- Standalone mode for static peer lists, no server required
- Interactive setup wizard (
meshd -setup) - SIGHUP for immediate sync, SIGTERM/SIGINT for clean shutdown
- Atomic config writes (temp → fsync → rename)
Requirements
- Linux with
wireguard-toolsinstalled - One reachable host for
coordserver(coordinated mode only)
Full Changelog: https://github.com/Yacin1102/Knoten/commits/0.2.0-alpha