zerotier / ZeroTierNAS

NAS packages for ZeroTier
https://zerotier.com
445 stars 95 forks source link

Zerotier on Synology DS418 running DSM 7 (Synology, DS418, DSM 7.1) #122

Open fbhradec opened 2 years ago

fbhradec commented 2 years ago

according to the documentation, the way to install zerotier on DSM 7 and up is by using docker.

The problem is synology doesn't allow DS418 to run docker.

Since part of the docker installation requires manually load TUN kernel module, I was wondering if using the zerotier-one binary from DSM6 pkg, I could manually install zerotier on DSM7 without docker.

I copied over zerotier-one binary from another DS418 NAS I have running DSM6, and zerotier-one runs without issue.

Is there anything special to setup apart from loading the TUN module, or by just loading tun and running sudo zerotier-one -d should be enough to get zerotier online on DSM 7?

thanks for any help... I really appreciate!

joseph-henry commented 2 years ago

Hello. Yes that should work. But there is an undocumented bug in Synology's synonetd that causes the removal of certain routes added to the system. This will break ZT. This issue is mitigated by using the following script (what we use in DSM6):

https://github.com/zerotier/ZeroTierOne/blob/master/pkg/synology/dsm6-pkg/start-stop-status.sh

There's a PR to improve that script btw so take a look at that too. You'll probably want it:

https://github.com/zerotier/ZeroTierOne/pull/1704

fbhradec commented 2 years ago

That's perfect! Thanks!

And I can confirm, it does work. So, just to keep this registered in case someone else is trying to do this:

  1. I've copied over /volume1/@appstore/zerotier from the old DSM6 NAS that have zerotier installed and running, to the new DS418 running DSM7, and just put it in one of the admin user home folder. In my case, /volume1/homes/<admin_user>/zerotier/

  2. I've downloaded https://github.com/zerotier/ZeroTierOne/blob/master/pkg/synology/dsm6-pkg/start-stop-status.sh into the admin user /volume1/homes/<admin_user>/zerotier/ folder

  3. I've edited start-stop-status.sh to add the following line right after #!/bin/sh, so everything could work correctly with the zerotier folder residing in the admin user home folder: SYNOPKG_PKGDEST=$(dirname $(readlink -f $0))

  4. I've used the task scheduler in DSM7 to start it up at boot-up, as root user, by running the script: /bin/bash /volume1/homes/<admin_user>/zerotier/start-stop-status.sh start image

And voila'. Zerotier is online on DS418 without docker! Thanks lots for the help!

BlipRanger commented 1 year ago

@fbhradec, I have the same issue but no pre-existing DSM6 devices. Any recommendation on sourcing the zerotier install folder?

kleuter commented 9 months ago

https://crystalidea.com/blog/zerotier-synology-arm-no-docker