.Dd October 1, 2021 .Dt WGGEN 8 .Os .Sh NAME .Nm wggen .Nd generate new wireguard peers .Sh SYNOPSIS .Nm .Ar hostname .Sh DESCRIPTION .Nm is a simple wireguard config management tool. Currently, it has one function: adding new wireguard peers. Given a .Ar hostname , it will find the next available IP and create a private key, public key, and .Xr wg-quick 8 config that can be given to the end user (see .Sx FILES ) . .Pp .Nm will then update the .Xr hostname.if 5 file for the wireguard interface and restart the endpoint with .Xr netstart 8 . .Sh ENVIRONMENT .Bl -tag -width "HOSTFILE" .It Ev DATADIR Alternate location to store the list of hosts and keys instead of .Pa /etc/wg .It Ev HOSTFILE Alternate file to store the host allocation instead of .Pa /DATADIR/hosts .El .Sh FILES .Bl -tag -width Ds .It Pa /etc/wg/hosts master list of host to IP allocation .It Pa /etc/wg//private.key client's private key .It Pa /etc/wg//public.key client's public key .It Pa /etc/wg//client.conf .Xr wg-quick 8 config (contains public and private keys, as well as IP address) .El .Sh EXAMPLES Generate a new key for a laptop: .Bd -literal -offset indent # wggen alex-laptop # mail -s "Your wg-quick config" alex < /etc/wg/alex-laptop/client.conf .Ed .Sh SEE ALSO .Xr wg 4 , .Xr ifconfig 8 , .Xr wg-quick 8 .Sh HISTORY Added via ~alex and ~anthony on 9/29/21 to garbash to make it easy to give users (read: themselves) new wireguard configs. For the full story behind the hack, see: .Lk https://garbash.com/~alex/notes/009-wireguard.txt