A private network
The servers of a group, and an edge, talk over a private network.
Your provider may have one (Hetzner, DigitalOcean and others). Then you do not need this page: set each server's --private-ip (see An edge in front).
If not, lf network makes one with WireGuard.
# join edge1, vps1 and vps2 in a private network called lan
lf network add lan edge1 vps1 vps2
# add vps3 later
lf network add lan vps3
# each server's address, its peers and when they last talked
lf network lan
# take vps3 out again; lf network rm lan removes the whole network
lf network rm lan vps3How it works
- Each server gets an address from
10.77.0.0/24, or the next free range.--subnetand--portchoose them for a new network. - A server without a private address gets its network address as its private address. An edge and pinned services use it.
- Each server makes its own key. The private key never leaves the server; only public keys pass through your computer.
- The servers send UDP to each other on port 51820, or the network's port. landfall opens it in ufw. Open it in a cloud firewall in front of the servers yourself.
- Each server reaches the others at the address ssh uses for them.
- A server behind NAT or a jump host is often not reachable at that address. Its peers then cannot reach it.
- It needs systemd. It installs
wireguard-toolsand runswg-quick@lf-<name>, so the network comes back after a reboot. - A peer whose handshake is missing or older than a few minutes does not get packets: check the firewall in front.
lf undotakes a server's part back on that server. Your local list of networks stays as it was.lf network addwith no new server writes the network to all its servers again. That restarts WireGuard there. It brings back a network thatlf undoor a reinstall took off.