~krystianch/wgpeer

Add WireGuard peers quickly

clone

read-only
https://git.sr.ht/~krystianch/wgpeer
read/write
git@git.sr.ht:~krystianch/wgpeer

You can also use your local clone with git send-email.

#wgpeer

Add WireGuard peers quickly

Browse here for usage information.

Example session:

$ wgpeer -q newtestpeer 10.0.0.42/24
█████████████████████████████████████████████████████████████████
█████████████████████████████████████████████████████████████████
████ ▄▄▄▄▄ █▄ ▀▀▀▀▄▀█▄▄ ▀▀ ▀ ▄▄▀█▀  █▄  ▀▄▀██ ▄ ▀▀▄ ██ ▄▄▄▄▄ ████
████ █   █ █  ▀▄  █▀██ ▀█▀ █ █ ▀▄  ▀▄█▀▀▀█▀██▄  ▄▀▄ ██ █   █ ████
████ █▄▄▄█ █▄▄  ▀▀▄▄▄  █▄█ █ ▄ ▄▄▄ ▀ █▀▄▄ ██▀█ █▄▄▀▄██ █▄▄▄█ ████
████▄▄▄▄▄▄▄█▄▀ █ ▀▄▀ ▀▄█ ▀▄█ █ █▄█ █ ▀▄█ █▄█ █▄▀▄█▄█▄█▄▄▄▄▄▄▄████
████ ▄  ▀▀▄█▄ █▀  ▀▀▄█ ▄  ▄█▄▄  ▄▄ █  ▄██▀█ ▄▀▀█▀███  █▀ ▄▄█▄████
████▀  ▄▀ ▄▀█▄▀▄▄█▄▀▀█ █ ▀▀▀▄▄█▄█▄▄ ▀█▀▄█▄█▄  █ █▄▄▀▀████▀▄▄▄████
████▀▀▄▄▀█▄█▄▄██▄▀▀▄  ██▄ █▀ ▀█▄▀ ▄▀█▀▄ ▀   ▀▄▄ █ ▄▀▄█▀█▀█ ▄█████
████▀  ▄  ▄█  ▀▄▀▄▀█▀▀▀ ▄▀  █▄▀█▄ ▀█▀ ██ ▄█▀▀█▀█▄ ▄ █▄█▀▄▄▀██████
██████▀██▄▄ ▀█ ▄█▀▀  ████ █ ▄▀▀▀▀█▄▄█ ▀█▀▄▄ ▀  ▀ █▀▀▄▀▄█▀▄▀▄▀████
████▀▀▀▄█ ▄ █▀██▀▄▄ █▄ █ ▀█  ▀▄▄█▄▀   ▀▄▀▀▀█   ▀▄▀▀▄▄ ▀█▀▄▄▀▀████
█████ █▀██▄▀ ▄▀▄ █▄ ▄█▀ ▀ █▄▀▄██  ███ ██▀▀▀█▄▄ ▀█▀██▀ ▄█▀█  █████
█████▀  ▄█▄▄ ██ ▄ █▄▀ ▄█▀█ ██ ▄▄▄ ▀████  ██▄▄▄▀▀ █ █ ██ █▄▀▄ ████
████▄▄▄▀▄ ▄▀█ ▀▄█ █▄ ▀ ▀▄▄▀▀▀▄█  ▀▄▀▀▄▄▀▄▀ ▀█▄█ ▀▀▄ █ ▀██▀▀▄ ████
█████▄▀▄ ▄▄▄ ▀▄ █▀▀▄█▀▀   ▀███ ▄▄▄ ▄██▄█▀ ▄▀▄█▄██▀██ ▄▄▄  ▀▄▀████
████  █▄ █▄█ ▀▀▀█▄▀█▀ ██▄▄ ▄██ █▄█ ▄▄ ▀▄▄▄▄  ▀▄  ▀▀▄ █▄█ ▄ ▀▀████
████ ▀ █▄ ▄▄▄█▀▄██ ▄ ▄▀  ▄██▀▀▄ ▄  ▄ ▄ ▀▀▄▄█▄▀▀▄██    ▄ ▄██▀▀████
████ ▄█▄ ▄▄▀ █▄▄ ▀▀ █▄█▀▄▄▄▄ █  █▄▄▄▀▀ █ ▀▄▀▄ ▄▄█ ▀█▄▀▄▄█▀█▀▄████
████▀█▀▀▀█▄█▄██▄▀▀   █▀ █▄ ███▄█ █▄ ▀█▄█▄██▀█ ▀▀  ▀ ▀ █ ▀▄▀  ████
████   █  ▄▀▄▀█  █▀ ▀ ▄▄▀█▀█ ▀█ ▀ ▄▄▀█▀▄ █ ▄█▄ ▄█▄▄▀▄█▄  ▀▀▄▀████
████ ▄█▀▀▀▄█▀▀▀█ ▀ █▀█▄██▄█▀▄▀▄█▀██▄▄█▀██ █▀ ▀ █▀▀▀▀█▄█▄▄█▀██████
████  ██▀▀▄  ▄▀▄ ███▀▄██▀█  █▄█▀▀█  ▀▀▄ █ ▄▄▀▀█ ▄ ▀▀██▄█▀▀▀▀ ████
█████▀█▀▄▀▄▀▄█▀ ▄▀▀ █ ▀ █ █▄▀█ ▀ ▀█▄▄ ▀ ▀█▄▄███▄██▄▄▄▄█ ████▀████
██████ ▄▀▀▄█ ▄▄ ▄▄▄█▄▄ ▄ █▄█▄▄▀▀▄▀ ▀▄█▄██ █ █ ▀▄ ██▀  ▀██▄ ▄▄████
████ ▀ ▀▀▄▄▄ ▀███▀▀▄▀ ▄▄  █▀▀▄▄▀▀██▀█ █▄  ▀▄ █ ▄█▀  ▀▄ ▀▀▀███████
██████████▄█▀ ▀▀▄▄▄ ▄▄ ▀▀██ █▄ ▄▄▄ █ ▀▀▀██ ▄▄ ▄ ▀▀██ ▄▄▄ █▀▄ ████
████ ▄▄▄▄▄ ███▄  █ █▄▄██▀▄█ ▄▄ █▄█ █▄█  ▄▄▀  ▀█ ▀▀ ▄ █▄█ ▄ ▀█████
████ █   █ █▀▄█ ██▀▄▀▄██ ▄▄██▀  ▄▄▄ ▄▀ ▄█▀█▀▀██▄▄▄  ▄▄ ▄▄ ▄ ▄████
████ █▄▄▄█ █ ▄█▄▄ ▄██ ▀▀▄▀▄ ▄█▄ ▀ ▄ ▀▄██ █▀  █▄▀▄▄▄  ▄▀██  █▀████
████▄▄▄▄▄▄▄█▄▄█▄██▄██▄█▄████▄█▄██▄█▄█▄▄██▄█▄▄▄███▄██▄▄█▄▄████████
█████████████████████████████████████████████████████████████████
█████████████████████████████████████████████████████████████████

--- /etc/wireguard/wg0.conf
+++ /etc/wireguard/wg0.conf
@@ -94,0 +95,5 @@
+
+[Peer]
+#friendly_name = newtestpeer
+PublicKey = Hy2i8V0h5BDoL+id49/sxWn5Zz5i/j7oldTKl9V2eC8=
+AllowedIPs = 10.0.0.42/32
Apply this patch? (y/n) y
patching file /etc/wireguard/wg0.conf
Reload wg0 configuration? (y/n) y
Watch for new peer's first handshake? (y/n) y
Watching...
New peer's first handshake successfull