synology-wireguard: The package is not compatible with DSM 7.1 on armada38x

Description After upgrading to DSM 7.1, running wg-quick causes a segmentation fault Steps to reproduce

$ ssh user@nas
$ sudo wg-quick up wg0

the result is: /usr/local/bin/wg-quick: line 30: 16471 Segmentation fault      "$@"

Then the system becomes unstable and it cannot be shut down properly. Interrupting the power supply is the only way to restart.

**Synology NAS model**
DS216j

**wg0.conf**

[Interface]
ListenPort = XXXXX
Address = 10.100.100.1/24
PrivateKey = 
PostUp =  iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE
PreDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
PublicKey = 
AllowedIPs = 10.100.100.2/32

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26

Most upvoted comments

FIY the toolkit is now available for 7.1 (in dev version)

no preBuild packages around somewhere?

Edit: Here https://www.blackvoid.club/wireguard-spk-for-your-synology-nas/

Ok I found the problem too, maybe I should have read the other posts first too… It’s the wrong pkgscripts-ng version.

To Fix this do the following in build.sh

diff --git a/build.sh b/build.sh
index 4a1afc0..57a2d32 100755
--- a/build.sh
+++ b/build.sh
@@ -36,7 +36,7 @@ if [[ ! -d /pkgscripts-ng ]] || [ -z "$(ls -A /pkgscripts-ng)" ]; then
     clone_args=""
     # If the DSM version is 7.0, use the DSM7.0 branch of pkgscripts-ng
     if [[ "$DSM_VER" =~ ^7\.[0-9]+$ ]]; then
-        clone_args="-b DSM7.0"
+        clone_args="-b DSM$DSM_VER"
         export PRODUCT="DSM"
     fi
     git clone ${clone_args} https://github.com/SynologyOpenSource/pkgscripts-ng

after that rebuild the image

docker build -t synobuild .

Now you should be able to build the module with version 7.1

I didn’t test the module yet because my DS1821+ is still running with DSM7.0 but I’ll test it in the next months.

After cloning the .git to synology-wireguard, alter the line in build.sh under “Fetch Synology toolchain” to be clone_args=“-b DSM7.1” . Under release.sh add “7.1” to the VERSIONS string. Then do "sudo docker build -t synobuild . " and follow instructions for your ARCH

My 7.1 spk has finished compiling, now I just have to upgrade my NAS to 7.1 and test.

you have to change version in a couple of places but most importantly build.sh to grab the 7.1 version of pkgscripts. I’m compiling a 7.1 version (hopefully) of Wireguard for DS220+ as we speak.