Repository navigation
Knoten_with_embedded_WireGuard
Pre-release
Pre-release
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.