runfalk / synology-wireguard

WireGuard support for some Synology NAS drives
MIT License
920 stars 131 forks source link

Add support for DSM 7.0 #71

Closed Matige closed 2 years ago

Matige commented 3 years ago

This pull request adds support for DSM 7.0. Additionally, a wg-init script has been developed, which allows you to easily add the WireGuard interface to autostart.

This package has been tested on DS220+ (geminilake) with DSM 7.0, and Virtual DSM (kvmx64) with DSM 6.2 and 7.0.

Matige commented 2 years ago

@cchhat01 compilation of the package should be done outside the DSM environment. Cross compilation is used, so the fact that the compilation is done on an amd64 platform is not a problem. If you have upgraded DSM to version 7, uninstall the previous version of the package before installing the new version. Then follow the installation instruction. Pay attention to step 4: after installing the package run sudo /var/packages/WireGuard/scripts/start

cchhat01 commented 2 years ago

@Matige holy crap that worked (and my apologies for overlooking that step)... Now how do I verify that the VPN is working through Wireguard and how do I route traffic through it ?

M4rt1n12 commented 2 years ago

@Matige holy crap that worked (and my apologies for overlooking that step)... Now how do I verify that the VPN is working through Wireguard and how do I route traffic through it ?

Maybe... I don't know... ping the other endpoint? :D And RTFM ;)

cchhat01 commented 2 years ago

Looks like I have a DNS entry in my wg0.conf as per the file provided by my VPN provider (WindScribe)

$ sudo wg-quick up wg0
Warning: `/etc/wireguard/wg0.conf' is world accessible
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 100.x.x.x/32 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] resolvconf -a wg0 -m 0 -x
/usr/local/bin/wg-quick: line 32: resolvconf: command not found
[#] ip link delete dev wg0

Is there anything that I can do to resolve this (pun intended)? I searched for solutions but most of the solutions are for non-synology users.

M4rt1n12 commented 2 years ago

How about remove the DNS entry from wg0.conf?

cchhat01 commented 2 years ago

How about remove the DNS entry from wg0.conf?

Would that not leak DNS ?

Dark1886 commented 1 year ago

@Matige holy crap that worked (and my apologies for overlooking that step)... Now how do I verify that the VPN is working through Wireguard and how do I route traffic through it ?

Explain like I’m dumb. Does this just mean you need to compile it on a different PC than the synology itself?

runfalk commented 1 year ago

Yes. You run follow the steps in the compilation section of the README on your normal computer (not your NAS). That generates a package that can then be installed on your Synology NAS through the web UI. Don't forget to read all the instructions because it's a bit more involved on DSM 7.