To install wireguard on an older Linux kernel. This is for versions greater than 3.10.
To check your linux version:
uname -r
yum install elfutils-libelf-devel kernel-devel pkgconfig "@Development Tools"
Clone the sources:
git clone https://git.zx2c4.com/wireguard-linux-compat
git clone https://git.zx2c4.com/wireguard-tools
Update wireguard-linux-compat/src/socket.c with the following after the includes:
#undef ipv6_dst_lookup_flow
#define ipv6_dst_lookup_flow(a, b, c, d) ipv6_dst_lookup(a, b, &dst, c) + (void *)0 ?: dst
Then make and install wireguard:
make -C wireguard-linux-compat/src -j$(nproc)
make -C wireguard-linux-compat/src install
https://www.wireguard.com/compilation/
https://www.reddit.com/r/WireGuard/comments/ho9pnr/20200623_of_wireguarddkms_build_error_on_ubuntu/