Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WireGuard stops working after pi upgrade #1332

Closed
DJFraz opened this issue Jul 11, 2021 · 6 comments
Closed

WireGuard stops working after pi upgrade #1332

DJFraz opened this issue Jul 11, 2021 · 6 comments

Comments

@DJFraz
Copy link

DJFraz commented Jul 11, 2021

I’m running ubuntu on my pi 4 version B. Whenever I update my pi, WireGuard stops functioning and I have to uninstall/reinstall pivpn. I’m guessing this has something to do with the kernel being updated.

I attempted to restore a backup I made with pivpn prior to it no longer working, but still couldn’t get things working again. I’ll probably have to start from scratch and have to readd all my clients again.

Is there an easier way to do all this or is this just how it is with WireGuard on pi?

thanks.

@orazioedoardo
Copy link
Member

Both Raspbian 10 and Ubuntu 20.04 (and later) have been shipping the WireGuard bundled with the kernel for quite some time now. I've not tested Ubuntu lately but on Raspbian I haven't experienced a breakage on kernel upgrades in the last six months or more. Are you using a custom kernel? Perhaps post the debug log here the next time it breaks so we can attempt to figure out.

@TheUntouchable
Copy link

TheUntouchable commented Jul 16, 2021

If by "pi upgrade" you mean running "rpi-update".

Important! Avoid using rpi-update if you plan to run WireGuard. rpi-update installs development kernel that don't always come with matching kernel headers, which are required to successfully compile the module.

Reinstall latest kernel and kernel headers: sudo apt install --reinstall raspberrypi-kernel raspberrypi-kernel-headers.
Reboot into the new kernel: sudo reboot.
Recompile WireGuard kernel module: sudo dpkg-reconfigure wireguard-dkms.
Restart WireGuard (you should get no output): sudo systemctl restart wg-quick@wg0.
Run pivpn -d and verify that all checks are [OK].

https://github.com/pivpn/pivpn/wiki/WireGuard#how-to-i-fix-a-broken-wireguard-update

"rpi-update" should not be used for normal use anyway.

@DJFraz
Copy link
Author

DJFraz commented Jul 16, 2021

If by "pi upgrade" you mean running "rpi-update".

Nope. I've only ever ran sudo apt upgrade on it as I run Ubuntu for Pi.

@TheUntouchable
Copy link

Mh okay, running here on raspberry os lite without any prolems since months.. :)

@orazioedoardo
Copy link
Member

At most you need to do what @TheUntouchable suggested, definitely you don't need to reinstall PiVPN. Can't say much besides wait for the issue to come up again and then take a look.

@tobiabocchi
Copy link

I've had a similar problem after updating Ubuntu.. I solved it reloading systemctl's deamon with sudo systemctl daemon-reload and sudo systmectl restart wg-quick@wg0.service

@coolapso coolapso closed this as completed Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants