Skip to content

Instantly share code, notes, and snippets.

@grahamc
Created April 30, 2019 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/f16e5ba709d600f2cd215b814251d100 to your computer and use it in GitHub Desktop.
Save grahamc/f16e5ba709d600f2cd215b814251d100 to your computer and use it in GitHub Desktop.
#! /nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/bash -e
modprobe wireguard
ip link add dev wg0 type wireguard
ip address add 10.10.2.10/24 dev wg0
wg set wg0 private-key /path/to/wireguard-private-key
wg set wg0 peer BQ7+...= endpoint wireguard.hostname.com:51820 persistent-keepalive 25 allowed-ips 10.10.2.5/32
ip link set up dev wg0
ip route replace 10.10.2.5/32 dev wg0 table main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment