config

System config files for garbash.com
git clone git://git.garbash.com/alex/config
Log | Files | Refs | README | LICENSE

wggen.8 (1557B)


      1 .Dd October 1, 2021
      2 .Dt WGGEN 8
      3 .Os
      4 .Sh NAME
      5 .Nm wggen
      6 .Nd generate new wireguard peers
      7 .Sh SYNOPSIS
      8 .Nm
      9 .Ar hostname
     10 .Sh DESCRIPTION
     11 .Nm
     12 is a simple wireguard config management tool.
     13 Currently, it has one function: adding new wireguard peers.
     14 Given a
     15 .Ar hostname ,
     16 it will find the next available IP
     17 and create a private key, public key, and
     18 .Xr wg-quick 8
     19 config that can be given to the end user (see
     20 .Sx FILES ) .
     21 .Pp
     22 .Nm
     23 will then update the
     24 .Xr hostname.if 5
     25 file for the wireguard interface and restart the endpoint with
     26 .Xr netstart 8 .
     27 .Sh ENVIRONMENT
     28 .Bl -tag -width "HOSTFILE"
     29 .It Ev DATADIR
     30 Alternate location to store the list of hosts and keys instead of
     31 .Pa /etc/wg
     32 .It Ev HOSTFILE
     33 Alternate file to store the host allocation instead of
     34 .Pa /DATADIR/hosts
     35 .El
     36 .Sh FILES
     37 .Bl -tag -width Ds
     38 .It Pa /etc/wg/hosts
     39 master list of host to IP allocation
     40 .It Pa /etc/wg/<hostname>/private.key
     41 client's private key
     42 .It Pa /etc/wg/<hostname>/public.key
     43 client's public key
     44 .It Pa /etc/wg/<hostname>/client.conf
     45 .Xr wg-quick 8
     46 config (contains public and private keys, as well as IP address)
     47 .El
     48 .Sh EXAMPLES
     49 Generate a new key for a laptop:
     50 .Bd -literal -offset indent
     51 # wggen alex-laptop
     52 # mail -s "Your wg-quick config" alex < /etc/wg/alex-laptop/client.conf
     53 .Ed
     54 .Sh SEE ALSO
     55 .Xr wg 4 ,
     56 .Xr ifconfig 8 ,
     57 .Xr wg-quick 8
     58 .Sh HISTORY
     59 Added via ~alex and ~anthony on 9/29/21 to garbash to make it easy to give users
     60 (read: themselves) new wireguard configs.
     61 For the full story behind the hack, see:
     62 .Lk https://garbash.com/~alex/notes/009-wireguard.txt