Wireguard no Longer working - DietPi Upgrade Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
TheBrokenGod
Posts: 5
Joined: Tue Dec 08, 2020 6:58 pm

Wireguard no Longer working - DietPi Upgrade

Post by TheBrokenGod »

So I did the latest DietPI upgrade and I think I may have gotten too new of a kernel.

When I tried to run Wireguard it would try to handshake and never connect.

Running

Code: Select all

sudo dpkg-reconfigure wireguard-dkms
It gets stuck

Code: Select all

Module build for kernel 5.4.79-v8+ was skipped since the
kernel headers for this kernel does not seem to be installed.
My uname -r shows 5.4.79-v7+

Any help would be appreciated.
User avatar
Joulinar
Posts: 3131
Joined: Sat Nov 16, 2019 12:49 am

Re: Wireguard no Longer working - DietPi Upgrade

Post by Joulinar »

Hi,

the message you have posted is as expected. you are running Raspberry OS 32bit, therefore compiling 64bit (5.4.79-v8+) is skipped by dpkg. Nothing to worry about.

Pls can you check status if wireguard

Code: Select all

systemctl status wg-quick@wg0.service
journalctl -u wg-quick@wg0
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
TheBrokenGod
Posts: 5
Joined: Tue Dec 08, 2020 6:58 pm

Re: Wireguard no Longer working - DietPi Upgrade

Post by TheBrokenGod »

Oh duh that makes sense, and for those commands

Here is the status of Wireguard.

Code: Select all

systemctl status wg-quick@wg0.service
● wg-quick@wg0.service - WireGuard via wg-quick(8) for wg0
   Loaded: loaded (/lib/systemd/system/wg-quick@.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2020-12-07 16:34:00 EST; 23h ago
     Docs: man:wg-quick(8)
           man:wg(8)
           https://www.wireguard.com/
           https://www.wireguard.com/quickstart/
           https://git.zx2c4.com/wireguard-tools/about/src/man/wg-quick.8
           https://git.zx2c4.com/wireguard-tools/about/src/man/wg.8
 Main PID: 610 (code=exited, status=1/FAILURE)
Trying Journal I get no entries, (It might be because I uninstalled/reinstalled Wireguard.
User avatar
Joulinar
Posts: 3131
Joined: Sat Nov 16, 2019 12:49 am

Re: Wireguard no Longer working - DietPi Upgrade

Post by Joulinar »

can you try following

Code: Select all

wg-quick up wg0
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
TheBrokenGod
Posts: 5
Joined: Tue Dec 08, 2020 6:58 pm

Re: Wireguard no Longer working - DietPi Upgrade

Post by TheBrokenGod »

Code: Select all

 wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.9.0.1/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a tun.wg0 -m 0 -x
[#] iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
[#] iptables -A FORWARD -i wg0 -j ACCEPT; iptables -A FORWARD -o wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Edit:

I tried to start it and it errored again but i got this

Code: Select all

sudo journalctl -u wg-quick@wg0
-- Logs begin at Tue 2020-12-08 10:55:12 EST, end at Tue 2020-12-08 16:05:27 EST. --
Dec 08 16:04:35 DietPi systemd[1]: Starting WireGuard via wg-quick(8) for wg0...
Dec 08 16:04:35 DietPi wg-quick[20710]: wg-quick: `wg0' already exists
Dec 08 16:04:35 DietPi systemd[1]: wg-quick@wg0.service: Main process exited, code=exited, status=1/FAI
LURE
Dec 08 16:04:35 DietPi systemd[1]: wg-quick@wg0.service: Failed with result 'exit-code'.
Dec 08 16:04:35 DietPi systemd[1]: Failed to start WireGuard via wg-quick(8) for wg0.
User avatar
Joulinar
Posts: 3131
Joined: Sat Nov 16, 2019 12:49 am

Re: Wireguard no Longer working - DietPi Upgrade

Post by Joulinar »

well you can't start wireguard interface wg0 twice ;)

Code: Select all

Dec 08 16:04:35 DietPi wg-quick[20710]: wg-quick: `wg0' already exists
before starting the service, you would need to bring down the interface you started manually before

Code: Select all

wg-quick down wg0
btw this doesn't looks like a DietPi wireguard server configuration. :?
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
TheBrokenGod
Posts: 5
Joined: Tue Dec 08, 2020 6:58 pm

Re: Wireguard no Longer working - DietPi Upgrade

Post by TheBrokenGod »

So bringing the interface down and starting it fixed my issue.
Wouldn't a reboot on the Pi have done that before?

Either way that fixed my issue.
Last edited by TheBrokenGod on Tue Dec 08, 2020 10:20 pm, edited 2 times in total.
User avatar
Joulinar
Posts: 3131
Joined: Sat Nov 16, 2019 12:49 am

Re: Wireguard no Longer working - DietPi Upgrade

Post by Joulinar »

yes probably a reboot would have been fixed it as well. This is always recommended after a kernel update to load the new version
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
TheBrokenGod
Posts: 5
Joined: Tue Dec 08, 2020 6:58 pm

Re: Wireguard no Longer working - DietPi Upgrade

Post by TheBrokenGod »

Strange, I reboot it twice and it still was acting up. Maybe the whole reinstall afterwards fixed it and just needed that.

Thanks for all the help.

Also, I set up wireguard before it was included in the DietPi-software I believe so maybe that is why it's not standard.

Would it be better if I uninstalled it and reinstalled it via dietpi-software?
Last edited by TheBrokenGod on Tue Dec 08, 2020 10:23 pm, edited 1 time in total.
User avatar
Joulinar
Posts: 3131
Joined: Sat Nov 16, 2019 12:49 am

Re: Wireguard no Longer working - DietPi Upgrade

Post by Joulinar »

TheBrokenGod wrote: Tue Dec 08, 2020 10:20 pm Also, I set up wireguard before it was included in the DietPi-software I believe so maybe that is why it's not standard.
that's a good explanation. At least it's fixed now :)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply