-
Add the WireGuard apt repo:
sudo add-apt-repository ppa:wireguard/wireguard sudo apt-get update
-
Install WireGuard:
sudo apt install wireguard -
Generate private key:
wg genkey > /etc/wireguard/private_key -
Generate public key:
wg pubkey < /etc/wireguard/private_key > /etc/wg/public_key -
Create a WireGuard interface configuration file:
nano /etc/wireguard/{int}.conf:[Interface] ListenPort = 54321 PrivateKey = +PL/53noze0Gxx2QzY2fDy24E4jX42LoD/RIMpJP7lI= [Peer] PublicKey = juvTm8/xAjCNRnGcQq0hormgBvSIZLCrb6sSk2dFa2s= AllowedIPs = 0.0.0.0/0 Endpoint = 104.248.2.255:54321
-
Create directory for WireGuard scripts:
sudo mkdir -p /opt/wireguard -
Copy over
wg_up.pyto/opt/wireguard/ -
Create a WireGuard extra config file:
nano /etc/wireguard{int}_extra.conf:[interface] routes = name = wg0 address = 10.200.200.2/30
-
Bring up WireGuard interface with python config script:
sudo python3 wg_up.py --wg_conf /etc/wireguard/wgx.conf --wg_extra_conf /etc/wireguard/wgx_extra.conf
Created
May 16, 2019 16:12
-
-
Save cyrex562/553398e6946ee409c86072fd021b56d5 to your computer and use it in GitHub Desktop.
Setup Wireguard on a Linux Host
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment