Install WireGuard on Linux (CLI)
azirevpn-wg script (recommended)
-
Install WireGuard
sudo add-apt-repository ppa:wireguard/wireguard sudo apt-get update sudo apt-get install wireguard jq resolvconf
echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' > /etc/apt/preferences.d/limit-unstable apt update apt install wireguard jq resolvconf
pkg install wireguard
emerge wireguard
apk add -U wireguard-tools
sudo pacman -S wireguard-dkms wireguard-tools
sudo dnf copr enable jdoss/wireguard sudo dnf install wireguard-dkms wireguard-tools
xbps-install -S wireguard
-
Run our configuration script and enter your username and password when prompted
curl -LO https://www.azirevpn.com/assets/dl/azirevpn-wg.sh && chmod +x ./azirevpn-wg.sh && ./azirevpn-wg.sh
-
Turn on WireGuard
wg-quick up azirevpn-se1
-
Turn off WireGuard
wg-quick down azirevpn-se1
Manual Configuration without Script
If you for some reason do not want to use our script which create a configuration file for you then this guide is for you.
-
Install WireGuard by following the official instructions
-
We will start by using the wg(8) tool to generate private and public keys as seen in the example below.
AzireVPN conf file
wg genkey | tee privatekey | wg pubkey > publickey cat privatekey 65G7oyb9jGxFXSCceTuFPHjjbPF2WVOCeNJ1SgPzzWk= cat publickey oP4Hdje7viyO+6Hz6QKQgHqD55w+Km9uZ0shmTFU0GI=
-
You are now ready to authenticate to our service by sending your login credentials and public key. As seen in the example below.
API request
curl -d username=REPLACE --data-urlencode password=REPLACE --data-urlencode key=REPLACE https://api.azirevpn.com/v2/ip/add { "status": "success", "ipv4": { "address": "10.0.1.XXX", "netmask": 32 }, "ipv6": { "address": "2a0e:1c80:1337:1:10:0:1:XXX", "netmask": 128 }, "dns": [ "91.231.153.2", "192.211.0.2", "2a0e:1c80:1337:1:10:0:0:1" ] }
-
You can now fetch location data from our API, as in seen in the example below.
curl https://api.azirevpn.com/v2/locations { "status": "success", "locations": [ { "name": "se-sto", "city": "Stockholm", "country": "Sweden", "iso": "se", "pool": "se-sto.flashbackvpn.net", "pubkey": "/a9J/rOJwM6MU2pzv3cwL20Tzdy03S3EDfAhPHqS5GA=" }, { "name": "nl-ams", "city": "Amsterdam", "country": "Netherlands", "iso": "nl", "pool": "nl-ams.flashbackvpn.net", "pubkey": "gSvCwsYn8JmX9djA/67gVwd1vxVUSICmgLQqv99y0Hw=" }, ... }
-
Now that our service has your public key we can begin to setup the interface on your computer. In this guide we'll be using the utility wg-quick(8) to help us setup our interface.
Let's start by creating a configuration file in /etc/wireguard/ folder. Name it azirevpn-se1.conf and include the example below but replace the data with the one you got in the curl responses.
/etc/wireguard/azirevpn-se1.conf example file
[Interface] PrivateKey = 65G7oyb9jGxFXSCceTuFPHjjbPF2WVOCeNJ1SgPzzWk= DNS = 193.180.164.2, 2a03:8600:1001::2 Address = 10.18.1.182/24, 2a03:8600:1001:1080::10b4/64 [Peer] PublicKey = bdR5gm5vcrm9N9I7BeQqHOgrmQApSGIe9qc1homBjk8= Endpoint = 193.180.164.60:51820 AllowedIPs = 0.0.0.0/0, ::/0
-
Turn on WireGuard
wg-quick up azirevpn-se1
-
Turn off WireGuard
wg-quick down azirevpn-se1