tusc / wireguard-kmod

WireGuard for UDM series routers
https://www.wireguard.com/
350 stars 18 forks source link

Installation failing on UDM-PRO SE #15

Closed jlauzer11 closed 3 years ago

jlauzer11 commented 3 years ago

Trying to set up the new UDM-PRO SE. Getting the following error:

root@UDM-PRO:/mnt/data/wireguard# ./setup_wireguard.sh loading wireguard... insmod: ERROR: could not load module /mnt/data/wireguard/wireguard-4.19.152-ui-alpine.ko: No such file or directory insmod: ERROR: could not load module /mnt/data/wireguard/iptable_raw-4.19.152-ui-alpine.ko: No such file or directory insmod: ERROR: could not load module /mnt/data/wireguard/ip6table_raw-4.19.152-ui-alpine.ko: No such file or directory root@UDM-PRO:/mnt/data/wireguard#

UNIFI OS VERSION: 2.2.4

peacey commented 3 years ago

Hi @jlauzer11,

The UDMP SE just came out, so hopefully they're using the same kernel (which it seems they might be because it's the same major version - 4.19.152). Can you please show the output of

zcat /proc/config.gz | grep LOCALVERSION

Also, can you give us the full output of

zcat /proc/config.gz

Better if you put it in a .txt file and upload it to your comment.

Thanks.

jlauzer11 commented 3 years ago

Please see attached. I put both commands in the same file. Files.txt

peacey commented 3 years ago

Thank you very much. But it seems like some of the config is missing. Can you make sure to paste the whole config from the first # Automatically generated file; DO NOT EDIT. line to the last # CONFIG_CORESIGHT is not set line? Or upload the output.txt file you generated.

jlauzer11 commented 3 years ago

Sorry, here is the full file for that. output.txt

peacey commented 3 years ago

Thank @jlauzer11.

So, some bad news. It seems that the kernel is slightly different than the UDMP. The UDMP uses 4.19.152-al-linux, and the SE uses 4.19.152-ul-alpine. This means we will need to request the new SE kernel sources from Ubiquiti to compile the module for the SE. Hopefully they'll give it to us like with the UDMP, but they might not because it's still in EA.

However, if they didn't do any major changes to the kernel other than changing the version, we might be able to compile it with the UDMP kernels and just change the version string. I have tried to do this and generated some modules for your UDM SE version. Please extract the zip file below into your /mnt/data/wireguard folder on your UDM, then try to run the setup script again and see if the modules load successfully this time. Check dmesg afterwards to see if there were any errors.

Remember, no guarantees this will work. Worst case the UDM will crash and restart.

FYI, you can extract the zip file into the folder like this:

cd /mnt/data/wireguard
wget https://github.com/tusc/wireguard-kmod/files/6871437/udm-se.zip
unzip udm-se.zip

udm-se.zip

jlauzer11 commented 3 years ago

Just ran the unzip and install. It looks like it took

[ 5369.083298] wireguard: WireGuard 1.0.20210606 loaded. See www.wireguard.com for information. [ 5369.083301] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.

I will try to run the rest of the configuration later tonight. Thanks so much for your quick help. I will report back so you know if this version is good to go for the SE to help others!

jlauzer11 commented 3 years ago

I deleted a second post. I thought I had an error message, but I re-ran dmesg and I think it looks okay...? Attaching since it is large. dmesg.txt

jlauzer11 commented 3 years ago

I was able to get an interface running. I shall test connecting a remote end later this evening:

root@UDM-PRO:~# wg-quick up wg0 Warning:/mnt/data/wireguard/etc/wireguard/wg0.conf' is world accessible [#] ip link add wg0 type wireguard [#] wg setconf wg0 /dev/fd/63 [#] ip -4 address add 10.10.10.1/24 dev wg0 [#] ip link set mtu 1420 up dev wg0 `

peacey commented 3 years ago

I was able to get an interface running. I shall test connecting a remote end later this evening:

root@UDM-PRO:~# wg-quick up wg0 Warning:/mnt/data/wireguard/etc/wireguard/wg0.conf' is world accessible [#] ip link add wg0 type wireguard [#] wg setconf wg0 /dev/fd/63 [#] ip -4 address add 10.10.10.1/24 dev wg0 [#] ip link set mtu 1420 up dev wg0 `

That's great! Looks very promising. Please do test the ability to route through the tunnel tonight, that would be fantastic!

jlauzer11 commented 3 years ago

@peacey Great news. I created two interfaces in the UDMP SE and connected them to Edgerouters that I have running clear across the state on separate networks. Both work perfectly! All of my remote devices come online right away. Your SE package is ready for prime time. Thank you so much for all you do and are quick work on getting this over to test.

peacey commented 3 years ago

That's great to hear @jlauzer11! Thank you very much for testing it so quickly. Please monitor if there are any issues for the next few days just in case. We will release an updated package shortly.

mazzy89 commented 2 years ago

Hey guys. first of all thanks a lot for the hard work you have done to bring wireguard into UDM SE device. I would need to make the exact same thing for the fuse module. I would need to run podman in the UDM PRO SE w/ overlay rather than vfs and I would need to build the fuse module. could you please point me to the kernel for the UDM PRO SE?

mazzy89 commented 2 years ago

I've found them https://github.com/tusc/wireguard-kmod/tree/main/src/bases/udm-se-2.2.4 🔝