Closed lukekenny closed 2 years ago
Hi @lukekenny,
You are using the UDR, correct? Can you please confirm that you only installed the WireGuard package to /data/wireguard
and not /mnt/data/wireguard
? If it's in both folders, it will cause an error.
Make sure you installed it to /data, then delete any installation in /mnt/data and restart the systemd service.
rm -rf /mnt/data/wireguard
rm -rf /etc/wireguard
systemctl restart setup-wireguard
systemctl status setup-wireguard
Check what the status says in the end.
Confirming there is no /mnt/data/wireguard directory (there is not even a /mnt/data directory,) and the package has been installed in /data/wireguard. Confirming this is an early access UDR, not a UDM, UDM-Pro or UDM-SE.
After removing /etc/wireguard, if I use systemctl restart setup-wireguard, it appears to work, however it creates /etc/etc/wireguard, and a links /etc/wireguard to /etc/etc/wireguard, and wg-quick is not found when I try to execute it.
If I delete those /etc/wireguard and /etc/etc/wireguard directories again and run the script directly, the link /etc/wireguard is linked to /data/wireguard/etc/wireguard, and wg-quick works.
Rebooting either after deleting the directories, or after deleting the directories then manually running the script, leads to the same kernel mismatch error.
Thanks @lukekenny. The startup service didn't work as expected. Can you try to use this setup-wireguard.service
instead?
[Unit]
Description=Run wireguard setup script
Wants=network.target
After=network.target
[Service]
Type=oneshot
ExecStart=sh -c 'WGDIR="$(find /mnt/data/wireguard /data/wireguard -maxdepth 1 -type d -name "wireguard" 2>/dev/null | head -n1)"; "$WGDIR/setup_wireguard.sh"'
[Install]
WantedBy=multi-user.target
Then delete all the /etc directories to start fresh and reload the service file.
rm -rf /etc/wireguard /etc/etc/wireguard
systemctl daemon-reload
systemctl start setup-wireguard
If it works this time, restart and confirm it works as well.
Solution works perfectly! Thanks @peacey!
Great @lukekenny! Closing this now as issue is fixed. Please feel free to open another issue if you have more problems! Have a nice day!
Package version
1.0.20210606-3
Firmware version
2.3.7
Device
Unifi Dream Machine (Pro / SE) - UDM
Issue description
On a UDR, this works fine when running the setup-wireguard.sh script from the CLI
However, when configuring it to load on boot as per the instructions, it doesn't work, and systemctl status setup-wireguard shows the error:
Unsupported Kernel version 4.4.198-ui-mtk
Configuration and log output