Skip to content

Instantly share code, notes, and snippets.

@pomo-mondreganto
Created November 12, 2020 13:07
Show Gist options
  • Save pomo-mondreganto/7f44b060ac5dbcd27727a84c2a158a00 to your computer and use it in GitHub Desktop.
Save pomo-mondreganto/7f44b060ac5dbcd27727a84c2a158a00 to your computer and use it in GitHub Desktop.
Wireguard installation for older kernels

First, try to install wireguard:

# this should fail with module compilation error
sudo apt update && sudo apt install -y wireguard wireguard-dkms wireguard-tools linux-headers-$(uname -r) build-essential

Then, go to /usr/src/wireguard-<version here> and comment out lines 96,97,99 in compat/compat.h to have

#define ipv6_dst_lookup_flow(a, b, c, d) ipv6_dst_lookup(a, b, &dst, c) + (void *)0 ?: dst

defined. After that, compile the kernel module with

sudo make clean && sudo make

Install it with

sudo insmod /usr/src/wireguard-<version>/wireguard.ko

Validate installation with (output should not be empty):

sudo lsmod | grep wireguard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment