WireGuard requires Linux kernel version ≥3.10, with the following configuration options, which are likely already configured in your kernel, especially if you’re installing via distribution packages.
CONFIG_NET for basic networking support
CONFIG_INET for basic IP support
CONFIG_NET_UDP_TUNNEL for sending and receiving UDP packets
CONFIG_CRYPTO_ALGAPI for crypto_xor
Raspberry Pi use Linux kernel version 5.4:
1 2 3 4 5 6
# cat /proc/version Linux version 5.4.72+ (dom@buildbot) (gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)) #1356 Thu Oct 22 13:56:00 BST 2020 # dpkg -l | grep raspberrypi-kernel ii raspberrypi-kernel 1.20201022-1 armhf Raspberry Pi bootloader ii raspberrypi-kernel-headers 1.20201022-1 armhf Header files for the Raspberry Pi Linux kernel
[38626.469261] wireguard: WireGuard 1.0.20200908-3-gda5646f loaded. See www.wireguard.com for information. [38626.469283] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
Step 4: Compile and install the wg(8) tool
1 2 3 4 5 6 7 8 9 10 11
$ make -C wireguard-tools/src -j$(nproc) $ sudo make -C wireguard-tools/src install
$ sudo wg-quick up wg0 $ sudo wg $ sudo sysctl -w net.ipv4.ip_forward=1 $ sudo sysctl -w net.ipv6.conf.all.forwarding=1 $ sudo ip rule list $ sudo ip route show table 0 $ sudo ip route show table all