-
Notifications
You must be signed in to change notification settings - Fork 11
Getting Started
It's fairly simple to get started with using WireGuard-Ligase. There are a number of pre-requisites to consider.
- A server running Linux.
- A sudo user to build server configuration and install all required software.
Currently Arch, CentOS, Debian, Fedora, Manjaro and Ubuntu are supported - meaning the script can:
- Check if WireGuard is installed. If WireGuard is not installed, the user will be offered to have it installed automatically.
- Configure distro-specific firewall rules. For example, CentOS will frequently use
firewalld
, hencefirewall-cmd
will be used instead ofiptables
. One notable exception is CentOS 7 running on AWS EC2 - which does not come withfirewalld
pre-installed. In this case the script knows it's running on CentOS withoutfirewalld
and will useiptables
instead. - In addition to configuring
iptables
the script is aware of how to makeiptables
rules persistent on supported distributions. For example on Ubuntuiptables-persistent
package will be used. On CentOS, Arch/Manjaro -iptables-service
package is used instead. - The script will still run on unsupported platform.
- In this case the script WILL:
- Build server and client configuration
- Will NOT:
- Install WireGuard
- Pre-configure firewall rules
- In this case the script WILL:
As discussed in supported distributions, the script can install WireGuard packages on Arch, CentOS, Debian, Fedora, Manjaro and Ubuntu. Other platforms will need to manually install WireGuard packages. (For a comprehensive list, check out the official website with installation guides. This Wiki will provide installation steps for the most common distributions.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
# echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
# printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable
# apt update
# apt install wireguard
$ sudo dnf copr enable jdoss/wireguard
$ sudo dnf install wireguard-dkms wireguard-tools
$ sudo curl -Lo /etc/yum.repos.d/wireguard.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo
$ sudo yum install epel-release
$ sudo yum install wireguard-dkms wireguard-tools
$ sudo urpmi wireguard-tools
$ sudo pacman -S wireguard-tools
Note that wireguard-dkms
will require headers for the Linux kernel installed / intended for use. Headers can be installed via Pacman. For example on Manjaro to install headers for Linux kernels 4.19, 5.0, and 5.1, one could use:
# Kernel 4.19
sudo pacman -S linux419-headers
# Kernel 5.0
sudo pacman -S linux50-headers
# Kernel 5.1
sudo pacman -S linux51-headers
$ sudo zypper addrepo -f obs://network:vpn:wireguard wireguard
$ sudo zypper install wireguard-kmp-default wireguard-tools
# apk add -U wireguard-tools
The installation requires edge repositories and edge kernel.
boot.extraModulePackages = [ config.boot.kernelPackages.wireguard ];
environment.systemPackages = [ pkgs.wireguard pkgs.wireguard-tools ];
# opkg install wireguard
# pkg install wireguard
$ brew install wireguard-tools
The best way to use WireGuard-Ligase is to clone the entire repository. This will ensure correct script execution. The following steps can be used:
- Clone the repository
$ git clone https://github.com/SirToffski/WireGuard-Ligase.git
- cd into the repository
$ cd WireGuard-Ligase/
- Run the helper-script
$ sudo bash configure-wireguard.sh
__ __ _ _ __ _
/ / /\ \ (_)_ __ ___ __ _ _ _ __ _ _ __ __| | / /(_) __ _ __ _ ___ ___
\ \/ \/ / | '__/ _ \/ _` | | | |/ _` | '__/ _` | / / | |/ _` |/ _` / __|/ _ \
\ /\ /| | | | __/ (_| | |_| | (_| | | | (_| | / /__| | (_| | (_| \__ \ __/
\/ \/ |_|_| \___|\__, |\__,_|\__,_|_| \__,_| \____/_|\__, |\__,_|___/\___|
|___/ |___/
Welcome to WG Ligase.
The script will guide you through the installaton process, allowing to choose a starting point.
The idea is for this script to be equally suitable for new deployments, as well as for configuring
a live deployment
Let's begin. Please select from one of the following options:
-----------------------------------
1 = Quick Setup. You will only be asked to specify public server IP.
-----------------------------------
2 = Advanced Setup: I would like to configure a new server and clients from scratch.
-----------------------------------
3 = Clients only: I just need to generate some client configs and add those to an existing server.
-----------------------------------
4 = IPTABLES: I just need commands to configure IPTABLEs.
----------------------------------