wglink docs

Quick start

Connect three machines in a few commands. wglink runs on one machine, the controller, which can be one of the nodes too.

1. Describe the machines

Create wglink.yaml, add each machine, and put them in a network.

wglink init                                # writes wglink.yaml here
wglink node add pve1 --ssh root@192.168.1.10
wglink node add nas  --ssh admin@192.168.1.20 --sudo
wglink node add pi   --ssh pi@192.168.1.30 --sudo
wglink connect pve1 nas pi --name lab

node add connects once to check the machine and tells you if anything is missing.

2. Preview the change

plan connects to every node, works out addresses and shows what would change. Nothing is changed yet.

$ wglink plan
network lab   wg-lab   10.99.0.0/24   udp/51820
  + pve1  10.99.0.1       new interface, 2 peers, new key
  + nas   10.99.0.2       new interface, 2 peers, new key
  + pi    10.99.0.3       new interface, 2 peers, new key

3 to create, 0 to change live, 0 to restart, 0 to remove.

3. Apply it and check

apply shows the same plan, asks for confirmation, then makes the change. status checks each tunnel.

$ wglink status
  pve1 <-> nas  ok  handshake 14s ago, ping 0.4 ms
  pve1 <-> pi   ok  idle, ping 1.1 ms
  nas <-> pi    ok  handshake 1m ago, ping 0.9 ms

All 3 links are ok.
Every node needs
  • Linux with sh, ip and wireguard-tools.
  • Root, or passwordless sudo for the user wglink connects as.
  • The WireGuard kernel module (Linux 5.6 and later) or wireguard-go.