dotfiles/wireguard/README.org

1.2 KiB

Wireguard Quick Start

https://www.wireguard.com/quickstart/

Level 3 VPN Protocol. Designed for Linux (works on BSD, MacOS and Windows too). Network Interface as most basic foundation of operation.

Linux CLI

Cheat Sheet: https://gist.github.com/chrisswanda/88ade75fc463dcf964c6411d1e9b20f4

Replace wg0 with an interface name for the VPN connection, e.g. homeoffice or mycloud

Tutorial with best Explaination: https://medium.com/tangram-visions/what-they-dont-tell-you-about-setting-up-a-wireguard-vpn-46f7bd168478

Create Keys

  $ umask 077
  $ wg genkey | tee privatekey | wg pubkey > publickey

Setup the Interface

  # sudo wg-quick up wg.conf.example

Add Peer

  # add peer
  wg set wg0 peer <client_pubkey> allowed-ips 10.0.0.x/32 persistent-keepalive 25

  # verify connection
  wg

  # save to config
  wg-quick save wg0

Start/Stop Interface

  # Start/stop interface
  wg-quick up wg0
  wg-quick down wg0

  # Start/stop service
  $ sudo systemctl stop wg-quick@wg0.service
  $ sudo systemctl start wg-quick@wg0.service