{"id":13821321,"url":"https://github.com/svenstaro/wiresmith","last_synced_at":"2025-04-04T09:09:36.360Z","repository":{"id":149972740,"uuid":"614620727","full_name":"svenstaro/wiresmith","owner":"svenstaro","description":"Auto-config WireGuard clients into a mesh","archived":false,"fork":false,"pushed_at":"2024-10-04T02:48:52.000Z","size":375,"stargazers_count":84,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-29T15:34:08.338Z","etag":null,"topics":["mesh","wireguard"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svenstaro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"svenstaro"}},"created_at":"2023-03-16T00:57:04.000Z","updated_at":"2024-10-21T01:08:39.000Z","dependencies_parsed_at":"2023-11-26T10:23:45.367Z","dependency_job_id":"ea996a02-9250-4d95-a4ed-5eec3a842fc3","html_url":"https://github.com/svenstaro/wiresmith","commit_stats":{"total_commits":157,"total_committers":5,"mean_commits":31.4,"dds":"0.30573248407643316","last_synced_commit":"a7060dc632c132409a49ec70545be9d99a90b21c"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenstaro%2Fwiresmith","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenstaro%2Fwiresmith/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenstaro%2Fwiresmith/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svenstaro%2Fwiresmith/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svenstaro","download_url":"https://codeload.github.com/svenstaro/wiresmith/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149502,"owners_count":20891954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mesh","wireguard"],"created_at":"2024-08-04T08:01:19.857Z","updated_at":"2025-04-04T09:09:36.344Z","avatar_url":"https://github.com/svenstaro.png","language":"Rust","funding_links":["https://github.com/sponsors/svenstaro"],"categories":["Projects","Rust","others"],"sub_categories":["Mesh Network"],"readme":"# wiresmith - Auto-config WireGuard clients into a mesh\n[![CI](https://github.com/svenstaro/wiresmith/actions/workflows/ci.yml/badge.svg)](https://github.com/svenstaro/wiresmith/actions)\n[![Crates.io](https://img.shields.io/crates/v/wiresmith.svg)](https://crates.io/crates/wiresmith)\n[![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/svenstaro/wiresmith/blob/master/LICENSE)\n[![Lines of Code](https://tokei.rs/b1/github/svenstaro/wiresmith)](https://github.com/svenstaro/wiresmith)\n\n**wiresmith** automatically discovers other peers using a shared backend and adds them to the local\nnetwork configuration while also publishing the local node so that others can talk to it. In short,\nit will create a self-maintaining mesh network using WireGuard.\n\nYou choose to let it figure out the addresses by itself or provide static addresses yourself. It\ncan also clean up dead peers if desired.\n\n## Features\n\n- Simple usage\n- Automatic address allocation\n- Mesh connectivity\n- IPv4/IPv6\n- Value store backends: Consul\n- Network configuration backends: systemd-networkd\n- Cleanup of dead peers\n- Pretty logging!\n\n## How to use\n\nYou need to at least provide the internal netork to use and the local node's endpoint. The endpoint\ncan either be an interface or a specific local interface address. For instance, one of the simplest\ninvocations would be:\n\n    wiresmith --network 192.168.0.0/24 --endpoint-interface eth0\n\nThis will:\n\n1. Connect to a local Consul agent\n2. Generate or load a local WireGuard configuration for `systemd-networkd`\n3. Use an address within the `192.168.0.0/24` WireGuard network for internal addressing\n4. Pick a usable global address from `eth0` and uses that to communicate with other peers\n\nThe endpoint interface needs to be reachable from all the other peers.\n\nIf you use [Consul\nFederation](https://developer.hashicorp.com/consul/tutorials/networking/federation-gossip-wan)\nwe fetch peers from all available datacenters using the same `--consul-prefix`\nvalue.\n\n## Usage\n\n    Auto-config WireGuard clients into a mesh\n\n    Usage: wiresmith [OPTIONS] --network \u003cNETWORK\u003e\n\n    Options:\n          --consul-address \u003cCONSUL_ADDRESS\u003e\n              Consul backend socket address\n\n              [default: http://127.0.0.1:8500]\n\n          --consul-token \u003cCONSUL_TOKEN\u003e\n              Consul secret token\n\n          --consul-ttl \u003cCONSUL_TTL\u003e\n              Consul TTL times out after this duration without being renewed\n\n              [default: 1min]\n\n          --consul-prefix \u003cCONSUL_PREFIX\u003e\n              Consul KV prefix\n\n              [default: wiresmith]\n\n      -u, --update-period \u003cUPDATE_PERIOD\u003e\n              Update period - how often to check for peer updates\n\n              [default: 10s]\n\n      -i, --wg-interface \u003cWG_INTERFACE\u003e\n              WireGuard interface name\n\n              [default: wg0]\n\n      -p, --wg-port \u003cWG_PORT\u003e\n              WireGuard UDP listen port\n\n              [default: 51820]\n\n      -k, --keepalive \u003cKEEPALIVE\u003e\n              Set persistent keepalive option for wireguard\n\n              Set to 0 in order to disable.\n\n              [default: 25s]\n\n          --endpoint-interface \u003cENDPOINT_INTERFACE\u003e\n              Public endpoint interface name\n\n              You need to provide either this or --endpoint-address.\n\n          --endpoint-address \u003cENDPOINT_ADDRESS\u003e\n              Public endpoint address\n\n              Can be a hostname or IP address. You need to provide either this or --endpoint-interface.\n\n          --network-backend \u003cNETWORK_BACKEND\u003e\n              Network configuration backend\n\n              [default: networkd]\n              [possible values: networkd]\n\n          --networkd-dir \u003cNETWORKD_DIR\u003e\n              Directory in which to place the generated networkd configuration\n\n              [default: /etc/systemd/network/]\n\n      -a, --address \u003cADDRESS\u003e\n              Address to allocate\n\n              If not provided, will allocate available address from the subnet. For instance 10.0.0.4 or fc00::4\n\n      -n, --network \u003cNETWORK\u003e\n              Network to use\n\n              Must be the same for all clients. For instance 10.0.0.0/24 or fc00::/64\n\n      -v, --verbose...\n              Be verbose\n\n              Provide twice for very verbose.\n\n      -h, --help\n              Print help (see a summary with '-h')\n\n      -V, --version\n              Print version\n\n## How to install\n\nPre-compiled binaries for supported platforms are available on the\n[releases](https://github.com/svenstaro/wiresmith/releases) page.\n\nIf you are on Arch Linux, you can just\n\n    pacman -S wiresmith\n\nAlternatively, you can use the provided OCI images using Podman or Docker:\n\n    podman run --rm --name wiresmith --cap-add SYS_ADMIN,NET_ADMIN --network host ghcr.io/svenstaro/wiresmith\n    docker run --rm --name wiresmith --privileged --network host ghcr.io/svenstaro/wiresmith\n\nYou can also use the provided systemd service.\n\n## Similar projects\n\nIf `wiresmith` doesn't fulfill your needs, perhaps one of these projects does:\n\n- [wg-meshconf](https://github.com/k4yt3x/wg-meshconf)\n- [autowire](https://github.com/elghazal-a/autowire)\n- [wgmesh](https://github.com/aschmidt75/wgmesh)\n\nYou might also find some tools in these lists:\n\n- [awesome-wireguard](https://github.com/cedrickchee/awesome-wireguard)\n- [WireGuardMeshes](https://github.com/HarvsG/WireGuardMeshes)\n\n## Development\n\nThis project uses Podman in rootless mode to facilitate rapid local testing. Before starting a\ndevelopment session, run\n\n    just prepare-test\n\nto make sure you have the necessary images.\n\nMake sure you have [just](https://github.com/casey/just) and [zellij](https://zellij.dev/)\ninstalled locally and then run either `just test` for automatic testing or `just interactive` for\ninteractive testing. The interactive session will spawn two systemds in containers and then run one\ninstance of `wiresmith` in each of them so you can watch them and see how they interact.\n\n## Releasing\n\nThis is mostly a note for me on how to release this thing:\n\n- Make sure `CHANGELOG.md` is up to date.\n- `cargo release \u003cversion\u003e`\n- `cargo release --execute \u003cversion\u003e`\n- OCI images and binaries will automatically be deployed by Github Actions.\n- Update Arch package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvenstaro%2Fwiresmith","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvenstaro%2Fwiresmith","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvenstaro%2Fwiresmith/lists"}