Skip to content

Instantly share code, notes, and snippets.

View robinlandstrom's full-sized avatar

Robin Landström robinlandstrom

View GitHub Profile
robinlandstrom /
Created February 21, 2019 20:16
Script to automatically add configration for a new peer to a wireguard server. It will then print a QR code to the console that can be used to add the config to the Android or OS X wireguard client.
readonly INTERFACE="wg0"
# Generate peer keys
readonly PRIVATE_KEY=$(wg genkey)
readonly PUBLIC_KEY=$(echo ${PRIVATE_KEY} | wg pubkey)
readonly PRESHARED_KEY=$(wg genpsk)
# Read server key from interface

Keybase proof

I hereby claim:

  • I am robinlandstrom on github.
  • I am robinlandstrom ( on keybase.
  • I have a public key ASAL1pQVmAobb3kgD4a4cF4gH4Jtw_1xYVDEA5pkSb3AmQo

To claim this, I am signing this object: