-
Notifications
You must be signed in to change notification settings - Fork 228
where to get wireguard kernel with k3s ubuntu 20.04 #768
Comments
where are these
|
@matti This is an awesome use-case! You'll want to add your CONFIG_ options to the config-patches file. You can set the Please post back if you need more help or get things working :) |
@matti Now that Kernel 5.10.x has been added, can you try this with |
It looks like the problem might be when trying to create the wireguard interface @gaby I added the 5.10 kernel, but if you go to manually create a wireguard interface (or really any ip link interface it looks like)
Error: Unknown device type. I've seen this type of error before with wireguard when missing kernel headers in debian, but even adding the headers does not seem to help in this case.
apt cache search for the headers only returns the following headers for 5.10
|
Perhaps we need to enable WIREGUARD in the kernel build: sudo ignite run --ssh weaveworks/ignite-k3s \
--name test-kernel --kernel-image weaveworks/ignite-kernel:5.10.21 sudo ignite exec test-kernel zgrep WIREGUARD /proc/config.gz
# CONFIG_WIREGUARD is not set |
See the README for https://github.com/weaveworks/ignite/blob/main/images/kernel. example patch: #497 |
I know sometimes building a kernel can sound intimidating. @darkowlzz and I would certainly be comfortable adding wireguard to the kernel build. |
The Gentoo guide mentions this:
gentoo-source: https://wiki.gentoo.org/wiki/Wireguard |
I made changes in https://github.com/weaveworks/ignite/blob/main/images/kernel/config-patches to add what looks to be the only missing config option from what https://wiki.gentoo.org/wiki/Wireguard lists as needed for wireguard post 5.6. config-patches
Then rebuilt the docker kernel image, and ran into the issue of ignite not wanting to pull that docker image and trying to match whatever's on quay I guess. The output of my builds
Here is the debnonet.yaml
So even after adding CONFIG_WIREGUARD=y to config-patches, and building the docker kernel image, I think I missed something and somehow didn't build the image with my config option added. I'll have a fresh look at it in the morning, I probably glossed over something in the Makefile. |
Any updates on this? |
@MikePadge sorry for the late response
The kernel-config and kernel builds definitely had some confusing structure. Specifically, when you update Adding Here is the patch for diff --git images/kernel/config-patches images/kernel/config-patches
index e73e292a..dd3dff40 100644
--- images/kernel/config-patches
+++ images/kernel/config-patches
@@ -1,5 +1,9 @@
# In this file, the recipe for patching all kernel configs (all versions & architectures) is
+# Enable wireguard
+# https://github.com/weaveworks/ignite/issues/768
+CONFIG_WIREGUARD=y
+
# Enable bonding/teaming
CONFIG_BONDING=y
CONFIG_NET_TEAM=y
diff --git images/kernel/generated/config-amd64-5.14.16 images/kernel/generated/config-amd64-5.14.16
index 91e5aab6..aaff5cc5 100644
--- images/kernel/generated/config-amd64-5.14.16
+++ images/kernel/generated/config-amd64-5.14.16
@@ -953,7 +953,7 @@ CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE_DEMUX=m
-CONFIG_NET_IP_TUNNEL=m
+CONFIG_NET_IP_TUNNEL=y
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE_COMMON=y
@@ -963,7 +963,7 @@ CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_SYN_COOKIES=y
CONFIG_NET_IPVTI=m
-CONFIG_NET_UDP_TUNNEL=m
+CONFIG_NET_UDP_TUNNEL=y
CONFIG_NET_FOU=m
CONFIG_NET_FOU_IP_TUNNELS=y
CONFIG_INET_AH=m
@@ -1822,7 +1822,8 @@ CONFIG_NETDEVICES=y
CONFIG_NET_CORE=y
CONFIG_BONDING=y
CONFIG_DUMMY=y
-# CONFIG_WIREGUARD is not set
+CONFIG_WIREGUARD=y
+# CONFIG_WIREGUARD_DEBUG is not set
# CONFIG_EQUALIZER is not set
# CONFIG_IFB is not set
CONFIG_NET_TEAM=y
@@ -3181,6 +3182,7 @@ CONFIG_IO_WQ=y
CONFIG_KEYS=y
# CONFIG_KEYS_REQUEST_CACHE is not set
CONFIG_PERSISTENT_KEYRINGS=y
+# CONFIG_BIG_KEYS is not set
CONFIG_ENCRYPTED_KEYS=y
# CONFIG_KEY_DH_OPERATIONS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
@@ -3281,7 +3283,7 @@ CONFIG_CRYPTO_ECDH=y
# CONFIG_CRYPTO_ECRDSA is not set
# CONFIG_CRYPTO_SM2 is not set
# CONFIG_CRYPTO_CURVE25519 is not set
-# CONFIG_CRYPTO_CURVE25519_X86 is not set
+CONFIG_CRYPTO_CURVE25519_X86=y
#
# Authenticated Encryption with Associated Data
@@ -3330,12 +3332,12 @@ CONFIG_CRYPTO_CRC32_PCLMUL=m
CONFIG_CRYPTO_XXHASH=m
CONFIG_CRYPTO_BLAKE2B=m
# CONFIG_CRYPTO_BLAKE2S is not set
-# CONFIG_CRYPTO_BLAKE2S_X86 is not set
+CONFIG_CRYPTO_BLAKE2S_X86=y
CONFIG_CRYPTO_CRCT10DIF=y
CONFIG_CRYPTO_CRCT10DIF_PCLMUL=y
CONFIG_CRYPTO_GHASH=m
CONFIG_CRYPTO_POLY1305=m
-CONFIG_CRYPTO_POLY1305_X86_64=m
+CONFIG_CRYPTO_POLY1305_X86_64=y
CONFIG_CRYPTO_MD4=m
CONFIG_CRYPTO_MD5=y
CONFIG_CRYPTO_MICHAEL_MIC=m
@@ -3377,7 +3379,7 @@ CONFIG_CRYPTO_DES3_EDE_X86_64=m
CONFIG_CRYPTO_FCRYPT=m
CONFIG_CRYPTO_KHAZAD=m
CONFIG_CRYPTO_CHACHA20=m
-CONFIG_CRYPTO_CHACHA20_X86_64=m
+CONFIG_CRYPTO_CHACHA20_X86_64=y
CONFIG_CRYPTO_SEED=m
CONFIG_CRYPTO_SERPENT=m
CONFIG_CRYPTO_SERPENT_SSE2_X86_64=m
@@ -3426,17 +3428,21 @@ CONFIG_CRYPTO_HASH_INFO=y
#
CONFIG_CRYPTO_LIB_AES=y
CONFIG_CRYPTO_LIB_ARC4=m
-# CONFIG_CRYPTO_LIB_BLAKE2S is not set
-CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=m
-CONFIG_CRYPTO_LIB_CHACHA_GENERIC=m
-# CONFIG_CRYPTO_LIB_CHACHA is not set
-# CONFIG_CRYPTO_LIB_CURVE25519 is not set
+CONFIG_CRYPTO_ARCH_HAVE_LIB_BLAKE2S=y
+CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
+CONFIG_CRYPTO_LIB_BLAKE2S=y
+CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y
+CONFIG_CRYPTO_LIB_CHACHA_GENERIC=y
+CONFIG_CRYPTO_LIB_CHACHA=y
+CONFIG_CRYPTO_ARCH_HAVE_LIB_CURVE25519=y
+CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=y
+CONFIG_CRYPTO_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_DES=m
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=11
-CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=m
-CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m
-# CONFIG_CRYPTO_LIB_POLY1305 is not set
-# CONFIG_CRYPTO_LIB_CHACHA20POLY1305 is not set
+CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=y
+CONFIG_CRYPTO_LIB_POLY1305_GENERIC=y
+CONFIG_CRYPTO_LIB_POLY1305=y
+CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
CONFIG_CRYPTO_LIB_SHA256=y
# CONFIG_CRYPTO_HW is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y
diff --git images/kernel/generated/config-arm64-5.14.16 images/kernel/generated/config-arm64-5.14.16
index 396e8592..f748ff43 100644
--- images/kernel/generated/config-arm64-5.14.16
+++ images/kernel/generated/config-arm64-5.14.16
@@ -580,7 +580,26 @@ CONFIG_ARM_SMCCC_SOC_ID=y
CONFIG_ARCH_SUPPORTS_ACPI=y
# CONFIG_ACPI is not set
# CONFIG_VIRTUALIZATION is not set
-# CONFIG_ARM64_CRYPTO is not set
+CONFIG_ARM64_CRYPTO=y
+# CONFIG_CRYPTO_SHA256_ARM64 is not set
+# CONFIG_CRYPTO_SHA512_ARM64 is not set
+# CONFIG_CRYPTO_SHA1_ARM64_CE is not set
+# CONFIG_CRYPTO_SHA2_ARM64_CE is not set
+# CONFIG_CRYPTO_SHA512_ARM64_CE is not set
+# CONFIG_CRYPTO_SHA3_ARM64 is not set
+# CONFIG_CRYPTO_SM3_ARM64_CE is not set
+# CONFIG_CRYPTO_SM4_ARM64_CE is not set
+# CONFIG_CRYPTO_GHASH_ARM64_CE is not set
+# CONFIG_CRYPTO_CRCT10DIF_ARM64_CE is not set
+# CONFIG_CRYPTO_AES_ARM64 is not set
+# CONFIG_CRYPTO_AES_ARM64_CE is not set
+# CONFIG_CRYPTO_AES_ARM64_CE_CCM is not set
+# CONFIG_CRYPTO_AES_ARM64_CE_BLK is not set
+# CONFIG_CRYPTO_AES_ARM64_NEON_BLK is not set
+CONFIG_CRYPTO_CHACHA20_NEON=y
+CONFIG_CRYPTO_POLY1305_NEON=y
+# CONFIG_CRYPTO_NHPOLY1305_NEON is not set
+# CONFIG_CRYPTO_AES_ARM64_BS is not set
#
# General architecture-dependent options
@@ -948,7 +967,7 @@ CONFIG_IP_PNP_BOOTP=y
CONFIG_IP_PNP_RARP=y
CONFIG_NET_IPIP=m
CONFIG_NET_IPGRE_DEMUX=m
-CONFIG_NET_IP_TUNNEL=m
+CONFIG_NET_IP_TUNNEL=y
CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_BROADCAST=y
CONFIG_IP_MROUTE_COMMON=y
@@ -958,7 +977,7 @@ CONFIG_IP_PIMSM_V1=y
CONFIG_IP_PIMSM_V2=y
CONFIG_SYN_COOKIES=y
CONFIG_NET_IPVTI=m
-CONFIG_NET_UDP_TUNNEL=m
+CONFIG_NET_UDP_TUNNEL=y
CONFIG_NET_FOU=m
CONFIG_NET_FOU_IP_TUNNELS=y
CONFIG_INET_AH=m
@@ -1824,7 +1843,8 @@ CONFIG_NETDEVICES=y
CONFIG_NET_CORE=y
CONFIG_BONDING=y
CONFIG_DUMMY=y
-# CONFIG_WIREGUARD is not set
+CONFIG_WIREGUARD=y
+# CONFIG_WIREGUARD_DEBUG is not set
# CONFIG_EQUALIZER is not set
# CONFIG_IFB is not set
CONFIG_NET_TEAM=y
@@ -3364,6 +3384,7 @@ CONFIG_IO_WQ=y
CONFIG_KEYS=y
# CONFIG_KEYS_REQUEST_CACHE is not set
CONFIG_PERSISTENT_KEYRINGS=y
+# CONFIG_BIG_KEYS is not set
CONFIG_ENCRYPTED_KEYS=y
# CONFIG_KEY_DH_OPERATIONS is not set
# CONFIG_SECURITY_DMESG_RESTRICT is not set
@@ -3580,15 +3601,19 @@ CONFIG_CRYPTO_HASH_INFO=y
#
CONFIG_CRYPTO_LIB_AES=y
CONFIG_CRYPTO_LIB_ARC4=m
-# CONFIG_CRYPTO_LIB_BLAKE2S is not set
-CONFIG_CRYPTO_LIB_CHACHA_GENERIC=m
-# CONFIG_CRYPTO_LIB_CHACHA is not set
-# CONFIG_CRYPTO_LIB_CURVE25519 is not set
+CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
+CONFIG_CRYPTO_LIB_BLAKE2S=y
+CONFIG_CRYPTO_ARCH_HAVE_LIB_CHACHA=y
+CONFIG_CRYPTO_LIB_CHACHA_GENERIC=y
+CONFIG_CRYPTO_LIB_CHACHA=y
+CONFIG_CRYPTO_LIB_CURVE25519_GENERIC=y
+CONFIG_CRYPTO_LIB_CURVE25519=y
CONFIG_CRYPTO_LIB_DES=m
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=9
+CONFIG_CRYPTO_ARCH_HAVE_LIB_POLY1305=y
CONFIG_CRYPTO_LIB_POLY1305_GENERIC=m
-# CONFIG_CRYPTO_LIB_POLY1305 is not set
-# CONFIG_CRYPTO_LIB_CHACHA20POLY1305 is not set
+CONFIG_CRYPTO_LIB_POLY1305=y
+CONFIG_CRYPTO_LIB_CHACHA20POLY1305=y
CONFIG_CRYPTO_LIB_SHA256=y
# CONFIG_CRYPTO_HW is not set
CONFIG_ASYMMETRIC_KEY_TYPE=y |
Made a personal branch to patch all the versions: Only the 5.10 and 5.14 kernels have any changes when this is patched in. Talked to @darkowlzz about some test plans. |
Hi, here's some update about wireguard support in ignite kernel and the results of my testing.
I followed the demo from https://www.wireguard.com/quickstart/ to test it out in two ignite VMs. On trying the demo instructions with a normal ignite-kernel, without wireguard in kernel support, it failed to add a new wireguard interface: # ip link add wg0 type wireguard
Error: Unknown device type. Created two new VMs using the new kernel and
Installed wireguard in them using The machines added each other as peers and were able to ping one another. VM 1: root@bc76d5641c509978:~# wg
interface: wg0
public key: 1pU23TWPn2XWhDfBfGsp6Qi9tqRlvQezy344uKbunic=
private key: (hidden)
listening port: 48949
peer: DXTGe2wN9SOvo6gzmwq86R0lRcudIbcnx491sCV7GyI=
endpoint: 10.61.0.13:44989
allowed ips: 10.0.0.2/32
latest handshake: 10 seconds ago
transfer: 916 B received, 4.45 KiB sent VM 2: root@1b4c0835855bc616:~# wg
interface: wg0
public key: DXTGe2wN9SOvo6gzmwq86R0lRcudIbcnx491sCV7GyI=
private key: (hidden)
listening port: 44989
peer: 1pU23TWPn2XWhDfBfGsp6Qi9tqRlvQezy344uKbunic=
endpoint: 10.61.0.14:48949
allowed ips: 10.0.0.1/32
latest handshake: 12 seconds ago
transfer: 860 B received, 4.65 KiB sent NOTE: Need to be careful with the ports. Based on the demo video, both the machines were listening on the same port. But when I tried the same commands, they were listening on two different ports and I had to change my set peer commands accordingly. Tested the same on arm64, raspberrypi-4, as well. |
#884 added support for wireguard in kernel 5.10 and 5.14, thanks to @stealthybox .
Using any ignite OS image with these kernel images should now have wireguard support. Closing this issue for now. Please open another issue for further discussions around it. |
error: Module wireguard not found in directory /lib/modules/5.4.43
The text was updated successfully, but these errors were encountered: