Use backports for compiling WireGuard from source. This makes it compatible also with older kernels.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-09-23 17:38:27 +02:00
parent b16365d956
commit 126cc21092
2 changed files with 49 additions and 13 deletions
+46 -13
View File
@@ -26,27 +26,60 @@ sudo apt install wireguard wireguard-tools wireguard-dkms
If there is no `wireguard` package available for your system, you can follow the instructions below to compile WireGuard from source.
<!-- markdownlint-disable code-block-style -->
???+ info "Compile WireGuard from source"
??? info "Compile WireGuard from source"
With the following commands, you can install WireGuard from source
With the following commands, you can install WireGuard from source as a backport of the WireGuard kernel module for Linux to 3.10 ≤ kernel ≤ 5.5 as an out-of-tree module. More recent kernels already include WireGuard themselves and you only need to install the `wireguard` tools.
### Update your local system
``` bash
sudo apt update && sudo apt upgrade -y
sudo apt install raspberrypi-kernel-headers libmnl-dev libelf-dev build-essential git -y
git clone https://git.zx2c4.com/WireGuard
cd WireGuard/src
sudo make
sudo make install
```
With these commands, you can update your locally compiled WireGuard at any time:
### Install the toolchain
=== "Raspberry Pi"
``` bash
sudo apt install -y raspberrypi-kernel-headers libelf-dev build-essential pkg-config git
```
=== "Linux"
``` bash
sudo apt install -y linux-headers-$(uname -r) libelf-dev build-essential libmnl-dev git
```
## Download and compile the `wireguard` module
``` bash
cd WireGuard/
git pull
cd src
sudo make
sudo make install
git clone https://git.zx2c4.com/wireguard-linux-compat
make -C wireguard-linux-compat/src -j$(nproc)
sudo make -C wireguard-linux-compat/src install
```
You can ignore messages like
``` plain
Warning: modules_install: missing 'System.map' file. Skipping depmod.
```
!!! info "Check the module installation was successful"
Run
``` bash
sudo modprobe wireguard
```
If there is no output, `wireguard` was loaded correctly. Note that it may be necessary to re-install the `wireguard` module when you update your system's kernel.
## Download and compile the `wireguard` tools (`wg`, etc.)
``` bash
git clone https://git.zx2c4.com/wireguard-tools
make -C wireguard-tools/src -j$(nproc)
sudo make -C wireguard-tools/src install
```
The ZX2C4 git repository is the official source for `wireguard-linux`, see [WireGuard#Repositories](https://www.wireguard.com/repositories/) (external link)
+3
View File
@@ -39,6 +39,9 @@ markdown_extensions:
- pymdownx.extra
# (https://facelessuser.github.io/pymdown-extensions/extensions/details/)
- pymdownx.details
# Tabbed provides a syntax to easily add tabbed Markdown content.
# https://facelessuser.github.io/pymdown-extensions/extensions/tabbed/
- pymdownx.tabbed
# Adds syntax for defining footnotes in Markdown documents (https://python-markdown.github.io/extensions/footnotes/)
- footnotes
# Adds the ability to define abbreviations