Skip to content

Instantly share code, notes, and snippets.

@TobleMiner
Created February 19, 2019 18:31
Show Gist options
  • Save TobleMiner/3ee2d4f5faba4e8eaa5064967fca8bbd to your computer and use it in GitHub Desktop.
Save TobleMiner/3ee2d4f5faba4e8eaa5064967fca8bbd to your computer and use it in GitHub Desktop.
Wireguard ifupdown
auto wg-ffki
iface wg-ffki inet manual
pre-up ip link add $IFACE type wireguard || true
pre-up wg set $IFACE listen-port 4242 private-key /root/wgsec
pre-up ip addr add 10.10.10.1/24 dev $IFACE || true
up ip link set $IFACE up
down ip link set $IFACE down
post-down ip addr del 10.10.10.1/24 dev $IFACE || true
auto wg-ffki
iface wg-ffki inet manual
pre-up wg set $IFACE peer CEtui81bm959xJ8ay8rRQwj/wFGWPj3bO9HAsG9m3Dw= allowed-ips 10.10.10.2/32 endpoint dn42.t-sys.eu:4242 persistent-keepalive 10
post-down wg set $IFACE peer CEtui81bm959xJ8ay8rRQwj/wFGWPj3bO9HAsG9m3Dw= remove
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment