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-se-sto
-
Turn off WireGuard
wg-quick down azirevpn-se-sto
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 { "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.azirevpn.net", "pubkey": "VYRJwI6n2Rpvh/gmYnUoyMJQDrUSdxls0JX9/6JlOEw=" }, { "name": "nl-ams", "city": "Amsterdam", "country": "Netherlands", "iso": "nl", "pool": "nl-ams.azirevpn.net", "pubkey": "W+LE+uFRyMRdYFCf7Jw0OPERNd1bcIm0gTKf/traIUk=" }, ... }
-
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-se-sto.conf and include the example below but replace the data with the one you got in the curl responses.
/etc/wireguard/azirevpn-se-sto.conf example file
[Interface] PrivateKey = 65G7oyb9jGxFXSCceTuFPHjjbPF2WVOCeNJ1SgPzzWk= Address = 10.0.0.123/32, 2a0e:1c80:1337:1:10:0:0:123/128 DNS = 91.231.153.2, 192.211.0.2, 2a0e:1c80:1337:1:10:0:0:1 [Peer] PublicKey = VYRJwI6n2Rpvh/gmYnUoyMJQDrUSdxls0JX9/6JlOEw= Endpoint = se-sto.azirevpn.net:51820 AllowedIPs = 0.0.0.0/0, ::/0
-
Turn on WireGuard
wg-quick up azirevpn-se-sto
-
Turn off WireGuard
wg-quick down azirevpn-se-sto
Delete an IP
Easily delete unused IP's to free up your limit.
curl --request DELETE -d username=REPLACE --data-urlencode password=REPLACE --data-urlencode key=REPLACE https://api.azirevpn.com/v2/ip { "status": "success", "message": "key has been deleted" }