This is a bash script to create a simple mesh network using WireGuard. Configuration is all performed over SSH and private keys never leave the machines.
Tested on Debian 11 and Raspberry Pi OS 11.
- SSH access to all hosts, either as root or as a user with password-less sudo rights
- A direct network connection between all hosts (this could be over the public Internet or local LAN)
- Rename or copy the
inventory-example
file toinventory
then edit it to your needs. See the comments for usage information. - Edit the variables at the top of
deploy.sh
if required - Run
./deploy.sh
to deploy and activate the network
- Install the
wireguard
package and its dependencies if it is not already present - Allocates a static IP address on the mesh network for each host, this is stored in the
cfg
directory - Generate private and public keys on each host, these are generated once per host+interface.
- Generate and install the config file for the mesh network interface on each host
- (optionally) Start or reconfigure the mesh network interface on each host