GithubHelp home page GithubHelp logo

runfalk / synology-wireguard Goto Github PK

View Code? Open in Web Editor NEW
901.0 38.0 128.0 94 KB

WireGuard support for some Synology NAS drives

License: MIT License

Shell 79.72% Makefile 18.92% Dockerfile 1.36%
wireguard synology

synology-wireguard's Introduction

WireGuard support for Synology NAS

This package adds WireGuard support for Synology NAS drives. It provides the WireGuard kernel module and the wg/wg-quick commands.

Disclaimer

You use everything here at your own risk. I am not responsible if this breaks your NAS. Realistically it should not result in data loss, but it could render your NAS unaccessible if something goes wrong.

If you are not comfortable with removing your drives from the NAS and manually recover the data, this might not be for you.

FAQ/Known issues

  • The releases in the releases page are for DSM 6 only. For DSM7, you'll need to follow the instructions in this readme and compile it yourself.
  • The Dns = x.x.x.x setting is unsupported. If you try it you will get the following message: /usr/local/bin/wg-quick: line 31: resolvconf: command not found
  • IPv6 is probably not supported (at least not using wg-quick). Due to the system version of iproute2 being too old. You'll get the error message Error: argument "suppress_prefixlength" is wrong: Failed to parse rule type.
  • Everything appears to be OK when running wg show but no traffic is flowing through the tunnel. Apparently there is some kind of race when setting up the interface. The simplest known workaround is to append ; sleep 5; ip route add 10.0.0.0/16 dev wg0 to the PostUp rule. This assumes that your WireGuard IP subnet is 10.0.x.x. See issue #10 for more information.

PRs that solve these issues are welcome.

Compatibility list

All models marked Is working have been confirmed by users to work. If your model has the same platform as one of the working ones, chances are it will work for you too. Note: the releases in the releases page are for DSM 6 only. For DSM7, you'll need to follow the instructions in this readme and compile it yourself.

Model Platform DSM Version Is working?
DS1019+ apollolake 6.2 Yes
DS114 armada370 N/A No (Kernel version too old)
DS115j armada370 N/A No (Kernel version too old)
DS116 armada38x 6.2 Yes
DS1511+ x64 6.2 Yes
DS1618+ denverton 6.2 Yes
DS1817+ avoton 6.2 Yes
DS1815+ avoton 6.2 Yes
DS213j armada370 N/A No (Kernel version too old)
DS213j armada370 N/A No (Kernel version too old)
DS214play armada370 N/A No (Kernel version too old)
DS214se armada370 N/A No (Kernel version too old)
DS216+II braswell 6.2 Yes
DS216se armada370 N/A No (Kernel version too old)
DS216Play monaco 6.2 Yes
DS218 rtd1296 6.2 Yes
DS218+ apollolake 6.2/7.0 Yes
DS218j armada38x 6.2 Yes
DS220+ geminilake 6.2/7.0 Yes
DS3617xs broadwell 6.2 Yes
DS414slim armada370 N/A No (Kernel version too old)
DS415+ avoton 6.2 Yes
DS418play apollolake 6.2 Yes
DS713+ cedarview 6.2 Yes
DS716+II braswell 6.2 Yes
DS718+ apollolake 6.2 Yes
DS720+ geminilake 7.0 Yes
DS916+ braswell 6.2 Yes
DS918+ apollolake 6.2 Yes
RS214 armada370 N/A No (Kernel version too old)
RS816 armada38x 6.2 Yes
Virtual DSM kvmx64 6.2/7.0 Yes

The minimum required kernel version is 3.10. If you have a kernel version lower than that, WireGuard will not work. You can check your kernel version by logging in through SSH and running the uname -a command.

This project is also confirmed to be compatible with other brand NAS stations using XPEnology.

Model Hardware version Platform DSM Version Is working?
HP54NL DS3615xs bromolow 6.2 Yes

Installation

  1. Check the releases page for SPKs for your platform and DSM version. If there is no SPK you have to compile it yourself using the instruction below.
  2. (Not applicable for DSM from 7.0) In the Synology DSM web admin UI, open the Package Center and press the Settings button. Set the trust level to Any publisher and press OK to confirm.
  3. In the Package Center, press the Manual install button and provide the SPK file. Follow the instructions until done.
  4. (Only for DSM from 7.0) From DSM 7.0, an additional step is required for the WireGuard package to start. This is related to preventing packages not signed by Synology from running with root privileges. When installing the package, uncheck the run after installation option. After installing the package, connect to the NAS via SSH and run the sudo /var/packages/WireGuard/scripts/start command.

Now you just need to figure out how to configure WireGuard. There are lots of good guides on how to do that.

To put my WireGuard configuration on the NAS, I used SSH and created a wg-quick configuration in /etc/wireguard/wg0.conf. My configuration looks like this:

[Interface]
Address = 10.0.1.1/16
PrivateKey = <nas-private-key>
ListenPort = 16666
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
PublicKey = <peer-public-key>
AllowedIPs = 10.0.1.2/32

Note that you need to modify the rules if your network interface is not eth0. You can check which name your interface has by running ip a in an SSH session.

Adding WireGuard to autostart

DSM since version 7.0 comes with systemd unit support, while for previous versions you can use the built-in upstart. To standardize the process of adding the WireGuard interface to the autostart, a simple wg-autostart script has been developed.

Important note: before adding the interface to the autostart, start it manually by sudo wg-quick up wg0 ensure that it does not cause the system to crash and that you can still access your NAS properly. Otherwise, you may not be able to start the NAS or you may not be able to access the device after a reboot.

To add the wg0 interface to the autostart, run the command:

sudo wg-autostart enable wg0

To remove the wg0 interface from the autostart, run the command:

sudo wg-autostart disable wg0

Compiling

I've used docker to compile everything, as pkgscripts-ng clutters the file system quite a bit. First create a docker image by running the following command in this repository:

git clone https://github.com/runfalk/synology-wireguard.git
cd synology-wireguard/
sudo docker build -t synobuild .

Now we can build for any platform and DSM version using:

sudo docker run --rm --privileged --env PACKAGE_ARCH=<arch> --env DSM_VER=<dsm-ver> -v $(pwd)/artifacts:/result_spk synobuild

You should replace <arch> with your NAS's package arch. Using this table you can figure out which one to use. Note that the package arch must be lowercase. <dsm-ver> should be replaced with the version of DSM you are compiling for.

For the DS218j that I have, the complete command looks like this:

sudo docker run --rm --privileged --env PACKAGE_ARCH=armada38x --env DSM_VER=6.2 -v $(pwd)/artifacts:/result_spk synobuild

If everything worked you should have a directory called artifacts that contains your SPK files.

Avoiding timeouts when downloading build files

It can take a long time to pull development files from SourceForge, including occasional timeouts. To get around this, create a folder locally and map it to the /toolkit_tarballs Docker volume using the following command: -v $(pwd)/<path/to/folder>:/toolkit_tarballs to the docker run command listed above. This will allow the development files to be stored on your host machine instead of ephemerally in the container. The image will check for existing development files in that folder and will use them instead of pulling them from SourceForge when possible. You can also download the files directly and put them in the folder you created by downloading them from here: https://sourceforge.net/projects/dsgpl/files/toolkit/DSM<DSM_VER> (e.g. https://sourceforge.net/projects/dsgpl/files/toolkit/DSM6.2)

Credits

I based a lot of this work on this guide by Reddit user akhener. However, I had to modify their instructions a lot since my NAS has an ARM CPU which made cross compilation a lot trickier.

GitHub user galaxysd made a guide on how to enable iptables NAT support.

synology-wireguard's People

Contributors

589290 avatar biogeekjoey avatar fredrike avatar jdeluyck avatar kraba avatar kuermel avatar lfilho avatar matige avatar mietzen avatar mkowalski avatar raman325 avatar reddec avatar rhysrhaven avatar runfalk avatar samczsun avatar seanauff avatar sloop0 avatar vstoms avatar war59312 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

synology-wireguard's Issues

Wireguard starts, but sends no packets to other peers

Description
I installed the synology-wireguard for the device. All seems to be going well, but when I start it up, wireguard doesn't send any packets over the connection. It's as if it doesn't even try.

Steps to reproduce

$ ssh user@nas
$ sudo wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 172.16.150.2/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
$ sudo wg show
interface: wg0
  public key: <redacted>
  private key: (hidden)
  listening port: 51820

peer: <redacted>
  endpoint: <public_ip_of_peer>:51820
  allowed ips: 172.16.150.1/32

Expected behavior
wireguard should send out packets to the <public_ip_of_peer> on port 51820. Instead it's not sending out anything.
tcpdump -i eth0 port 51820
doesn't show anything at all. eth0 is the correct interface.
Pinging to <public_ip_of_peer> works fine. Connecting with wireguard to that peer from another machine works fine as well.

Synology NAS model
DS1819+

wg0.conf

[Interface]
Address = 172.16.150.2/24
SaveConfig = true
ListenPort = 51820
PrivateKey = <redacted>

[Peer]
PublicKey = <redacted>
AllowedIPs = 172.16.150.1/32
Endpoint = <redacted>:51820

DS116 working

Hi

i just installed Wireguard on a DS116, it seems to work just fine.

Anmerkung 2020-08-06 123612

Data not transfering through when used as client

For my use case I want to use my NAS (216j) as an client to an existing wireguard server so I can use Download Station with the wireguard VPN. However I can't seem to get it working. When doing wg-quick up wg0 I get no error messages and starts up fine. Using wg show it shows it is connected but in the transfer tab it shows that almost no data has been fed trough it. When using an IPmagnet to see what IP my nas uses when downloading a torrent it shows my own IP and not the one I'm supposedly connected to. I also tried Deluge instead of Download Station but nothing changes.

My wg0.conf is as follow:

[Interface]
Address = 10.200.200.6/24
PrivateKey = [privatekey]


[Peer]
PublicKey = [publickey]
AllowedIPs = 10.0.0.0/24
Endpoint = [server-ip]
PersistentKeepalive = 25

I first wanted to use AllowedIPs = 0.0.0.0/0 to route all my network through the VPN, this works on my desktop and phone, but it gave my the following error: Error: argument "suppress_prefixlength" is wrong: Failed to parse rule type

Any ideas how to get this working?

RS816

FYI the armada38x version seems to work on the RS816

Managed to hit around 500Mbit/s, and that was with MooseFS writing to the chunk-server I'd managed to get running on the thing ;-)

Fails to install due to missing /usr/local/bin

There was no /usr/local/bin on my DS819 so the postinst script failed.

This also leaves the system in a state where an attempt to uninstall results in an error.

There should be instructions in the README on how to manually uninstall. Here's what I did:

rm -rf '/volume1/@appstore/WireGuard'
rm -rf /var/packages/WireGuard

After creating /usr/local/bin manually a subsequent installation succeeded.

Removing those two directories worked in my case but may not be exhaustive. The symlinks that the post inst script installs should also be removed.

suppress_prefixlength error (ip6 is already disabled)

1513+

my conf
[interface]
PrivateKey = xxxxxxxxxxxxx=
Address = 10.xxxx.3/32

[Peer]
PublicKey = VPS wg Key
PresharedKey = XXXX
AllowedIPs = 0.0.0.0/0
Endpoint = XXXX/57926
PersistentKeepalive = 25

it saves fine, when i run wg-quick up wg0 i get this

[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.xxx.3/32 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] wg set wg0 fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
Error: argument "suppress_prefixlength" is wrong: Failed to parse rule type
[#] ip -4 rule delete table 51820
[#] ip link delete dev wg0

Can't install it on my DS918+

Every time I try to install the latest package, I get this error:
Screenshot_2020 09 22_18h47m46s_003_

I already restarted my synology but no change.

Any idea what causes this? Trust level is set to "Any publisher":
image

Configuration parsing error

cannot start Wireguard tunnel as the config File wg0.conf contains errors

Steps to reproduce
install latest wireguard package (WireGuard-denverton-1.0.20200729.spk), copy my or create your own wg0.conf File in /etc/wireguard/wg0.conf and run

admin@mystor2:/etc/wireguard$ sudo wg setconf wg0 /etc/wireguard/wg0.conf
**Line unrecognized: `PostUp=iptables-AFORWARD-iwg0-jACCEPT;iptables-tnat-APOSTROUTING-oeth0-jMASQUERADE'
Configuration parsing error**

Even the "Address = xxx.xxx.xxx.xxx" Line from my wg0.conf below will create the same "parsing error" if i uncomment it.

Expected behavior
parse the file like described in the github and bring up wg0 according to the configfile specified parameters

Synology NAS model
DS1618+ DSM 6.2.3-25426 Update 2

wg0.conf

admin@mystor2:/etc/wireguard$ cat wg0.conf
[Interface]
# Address = 192.168.42.1/24
ListenPort=40404
PrivateKey=secret
# PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE


[Peer]
PublicKey=othersecret
AllowedIPs=192.168.42.100,fd00:42::100

Doublechecking the ubuntu wiki for wireguard "PostUp" and "Address" are put into /etc/network/interfaces and not the wg0.conf File (anymore?) Which File in the Synology would be the equivalent?

Synology DSM 6.2.3-25426 breaking WireGuard?

After update DSM to 6.2.3-25426 Wireguard has stopped working.
Wireguard start, clients connects but I can't ping anything on my network.

####CONFIG
[Interface]
Address = 192.168.3.200/24
PrivateKey = XXX
ListenPort = 16666
PostUp = sysctl -w net.ipv4.ip_forward=1
PostUp = sysctl -w net.ipv6.conf.all.forwarding=1
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o ovs_bond0 -j MASQUERADE; sleep 3; ip route add 192.168.3.200/32 dev wg0;
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o ovs_bond0 -j MASQUERADE

######ifconfig
wg0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:192.168.3.200 P-t-P:192.168.3.200 Mask:255.255.255.0
UP POINTOPOINT RUNNING NOARP MTU:1420 Metric:1
RX packets:834 errors:0 dropped:0 overruns:0 frame:0
TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:82196 (80.2 KiB) TX bytes:1676 (1.6 KiB)

###sudo wg show
interface: wg0
public key: XXXX
private key: (hidden)
listening port: 16666

peer:XXX
preshared key: (hidden)
endpoint: XX.XX.XX.XX:17509
allowed ips: 192.168.3.204/32
latest handshake: 1 minute, 21 seconds ago
transfer: 80.36 KiB received, 1.64 KiB sent

route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.3.254 0.0.0.0 UG 0 0 0 ovs_bond0
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
172.20.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker-bbc4c5ae
172.21.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker-a53abf62
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 ovs_bond0
192.168.3.200 0.0.0.0 255.255.255.255 UH 0 0 0 wg0
192.168.3.240 0.0.0.0 255.255.255.252 U 0 0 0 mynet-shim

Issue compiling with Braswell architecture [DS216-II]

I followed the docker instructions and received the following after a while. Any points on what might be required to correct this? (FYI I had tried without HAS_MEMNEQ first but received the same output).

sudo docker run --rm --privileged --env PACKAGE_ARCH=braswell --env DSM_VER=6.2 --env HAS_MEMNEQ=1 -v $(pwd)/artifacts:/result_spk synobuild
Cloning into 'pkgscripts-ng'...
Download... https://sourceforge.net/projects/dsgpl/files/toolkit/DSM6.2/base_env-6.2.txz
Download destination: /toolkit_tarballs/base_env-6.2.txz%
Download... https://sourceforge.net/projects/dsgpl/files/toolkit/DSM6.2/ds.braswell-6.2.env.txz
Download destination: /toolkit_tarballs/ds.braswell-6.2.env.txz
Download... https://sourceforge.net/projects/dsgpl/files/toolkit/DSM6.2/ds.braswell-6.2.dev.txz
Download destination: /toolkit_tarballs/ds.braswell-6.2.dev.txz
tar: usr/lib/jvm/java-7-jdk/jre/lib/i386/client: Directory renamed before its status could be extracted
tar: usr/lib/jvm/java-7-jdk/jre/lib/i386/server: Directory renamed before its status could be extracted
tar: usr/lib/jvm/java-7-jdk/jre/lib/i386: Directory renamed before its status could be extracted
tar: usr/lib/jvm/java-7-jdk/jre/lib: Directory renamed before its status could be extracted
tar: usr/lib/jvm/java-7-jdk/jre: Directory renamed before its status could be extracted
tar: usr/lib/python3.4/config-3.4m: Directory renamed before its status could be extracted
tar: usr/lib/python3.4: Directory renamed before its status could be extracted
tar: usr/lib/firmware/libertas: Directory renamed before its status could be extracted
tar: usr/lib/firmware: Directory renamed before its status could be extracted
tar: usr/lib/python2.7/config: Directory renamed before its status could be extracted
tar: usr/lib/python2.7: Directory renamed before its status could be extracted
tar: usr/lib/ccache/bin: Directory renamed before its status could be extracted
tar: usr/lib/ccache: Directory renamed before its status could be extracted
tar: usr/lib/systemd/system/shutdown.target.wants: Directory renamed before its status could be extracted
tar: usr/lib/systemd/system/multi-user.target.wants: Directory renamed before its status could be extracted
tar: usr/lib/systemd/system: Directory renamed before its status could be extracted
tar: usr/lib/systemd: Directory renamed before its status could be extracted
tar: usr/lib/p11-kit: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/eslint/node_modules/acorn-jsx/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/eslint/node_modules/acorn-jsx/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/eslint/node_modules/acorn-jsx: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/eslint/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/eslint/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/eslint: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/vue-loader/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/vue-loader/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/vue-loader: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/sass-loader/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/sass-loader/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/sass-loader: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/babel-loader/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/babel-loader/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/babel-loader: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/vue-template-compiler/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/vue-template-compiler/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/vue-template-compiler: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/jslint/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/jslint/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/jslint: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/file-loader/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/file-loader/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/file-loader: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/css-loader/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/css-loader/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/css-loader: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/jshint/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/jshint/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/jshint: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/node-sass/node_modules/node-gyp/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/node-sass/node_modules/node-gyp/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/node-sass/node_modules/node-gyp: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/node-sass/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/node-sass/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/node-sass: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/vue-style-loader/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/vue-style-loader/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/vue-style-loader: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack-dev-server/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack-dev-server/node_modules/webpack-dev-middleware/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack-dev-server/node_modules/webpack-dev-middleware/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack-dev-server/node_modules/webpack-dev-middleware: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack-dev-server/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack-dev-server: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack-cli/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack-cli/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/webpack-cli: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/core/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/core/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/core: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/preset-env/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/preset-env/node_modules/regjsparser/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/preset-env/node_modules/regjsparser/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/preset-env/node_modules/regjsparser: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/preset-env/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/preset-env: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/cli/node_modules/.bin: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/cli/node_modules: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel/cli: Directory renamed before its status could be extracted
tar: usr/lib/node_modules/@babel: Directory renamed before its status could be extracted
tar: usr/lib/node_modules: Directory renamed before its status could be extracted
tar: usr/include/gdbm: Directory renamed before its status could be extracted
tar: usr/include: Directory renamed before its status could be extracted
tar: usr/local/share: Directory renamed before its status could be extracted
tar: usr/local/tool: Directory renamed before its status could be extracted
tar: usr/local: Directory renamed before its status could be extracted
tar: usr/share/man/man7: Directory renamed before its status could be extracted
tar: usr/share/man/man5: Directory renamed before its status could be extracted
tar: usr/share/man/man1: Directory renamed before its status could be extracted
tar: usr/share/man: Directory renamed before its status could be extracted
tar: usr/share/vim/vimfiles/help: Directory renamed before its status could be extracted
tar: usr/share/vim/vimfiles/syntax: Directory renamed before its status could be extracted
tar: usr/share/vim/vimfiles/indent: Directory renamed before its status could be extracted
tar: usr/share/vim/vimfiles: Directory renamed before its status could be extracted
tar: usr/share/vim: Directory renamed before its status could be extracted
tar: usr/share/licenses/eslint: Directory renamed before its status could be extracted
tar: usr/share/licenses/xz: Directory renamed before its status could be extracted
tar: usr/share/licenses/p7zip: Directory renamed before its status could be extracted
tar: usr/share/licenses/gcc-multilib: Directory renamed before its status could be extracted
tar: usr/share/licenses/vim-runtime: Directory renamed before its status could be extracted
tar: usr/share/licenses: Directory renamed before its status could be extracted
tar: usr/share/doc/xz: Directory renamed before its status could be extracted
tar: usr/share/doc: Directory renamed before its status could be extracted
tar: usr/share/apache-ant: Directory renamed before its status could be extracted
tar: usr/share/locale/gl/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/gl: Directory renamed before its status could be extracted
tar: usr/share/locale/lt/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/lt: Directory renamed before its status could be extracted
tar: usr/share/locale/eo/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/eo: Directory renamed before its status could be extracted
tar: usr/share/locale/sk/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/sk: Directory renamed before its status could be extracted
tar: usr/share/locale/tr/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/tr: Directory renamed before its status could be extracted
tar: usr/share/locale/sl/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/sl: Directory renamed before its status could be extracted
tar: usr/share/locale/fi/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/fi: Directory renamed before its status could be extracted
tar: usr/share/locale/zh_TW/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/zh_TW: Directory renamed before its status could be extracted
tar: usr/share/locale/uk/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/uk: Directory renamed before its status could be extracted
tar: usr/share/locale/et/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/et: Directory renamed before its status could be extracted
tar: usr/share/locale/pt_BR/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/pt_BR: Directory renamed before its status could be extracted
tar: usr/share/locale/el/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/el: Directory renamed before its status could be extracted
tar: usr/share/locale/ia/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/ia: Directory renamed before its status could be extracted
tar: usr/share/locale/it/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/it: Directory renamed before its status could be extracted
tar: usr/share/locale/hr/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/hr: Directory renamed before its status could be extracted
tar: usr/share/locale/kk/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/kk: Directory renamed before its status could be extracted
tar: usr/share/locale/cs/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/cs: Directory renamed before its status could be extracted
tar: usr/share/locale/af/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/af: Directory renamed before its status could be extracted
tar: usr/share/locale/eu/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/eu: Directory renamed before its status could be extracted
tar: usr/share/locale/da/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/da: Directory renamed before its status could be extracted
tar: usr/share/locale/be/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/be: Directory renamed before its status could be extracted
tar: usr/share/locale/sv/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/sv: Directory renamed before its status could be extracted
tar: usr/share/locale/lg/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/lg: Directory renamed before its status could be extracted
tar: usr/share/locale/ko/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/ko: Directory renamed before its status could be extracted
tar: usr/share/locale/pt/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/pt: Directory renamed before its status could be extracted
tar: usr/share/locale/ms/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/ms: Directory renamed before its status could be extracted
tar: usr/share/locale/ja/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/ja: Directory renamed before its status could be extracted
tar: usr/share/locale/ga/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/ga: Directory renamed before its status could be extracted
tar: usr/share/locale/zh_CN/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/zh_CN: Directory renamed before its status could be extracted
tar: usr/share/locale/ru/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/ru: Directory renamed before its status could be extracted
tar: usr/share/locale/nl/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/nl: Directory renamed before its status could be extracted
tar: usr/share/locale/fr/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/fr: Directory renamed before its status could be extracted
tar: usr/share/locale/vi/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/vi: Directory renamed before its status could be extracted
tar: usr/share/locale/pl/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/pl: Directory renamed before its status could be extracted
tar: usr/share/locale/es/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/es: Directory renamed before its status could be extracted
tar: usr/share/locale/de/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/de: Directory renamed before its status could be extracted
tar: usr/share/locale/ro/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/ro: Directory renamed before its status could be extracted
tar: usr/share/locale/ca/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/ca: Directory renamed before its status could be extracted
tar: usr/share/locale/bg/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/bg: Directory renamed before its status could be extracted
tar: usr/share/locale/nb/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/nb: Directory renamed before its status could be extracted
tar: usr/share/locale/hu/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/hu: Directory renamed before its status could be extracted
tar: usr/share/locale/id/LC_TIME: Directory renamed before its status could be extracted
tar: usr/share/locale/id: Directory renamed before its status could be extracted
tar: usr/share/locale: Directory renamed before its status could be extracted
tar: usr/share/dict: Directory renamed before its status could be extracted
tar: usr/share: Directory renamed before its status could be extracted
tar: usr/lib32: Directory renamed before its status could be extracted
tar: root: Directory renamed before its status could be extracted
tar: etc: Directory renamed before its status could be extracted
tar: dev: Directory renamed before its status could be extracted
tar: Exiting with failure status due to previous errors
tar -xhf /toolkit_tarballs/base_env-6.2.txz -C /build_env/ds.braswell-6.2
Traceback (most recent call last):
  File "/pkgscripts-ng/include/python/parallel.py", line 12, in __call__
    result = self.__callable(*args, **kwargs)
  File "pkgscripts-ng/EnvDeploy", line 151, in deploy_base_env
    self.__extract__(base_tarball, BuildEnv.getChrootSynoBase(platform, self.version, self.suffix))
  File "pkgscripts-ng/EnvDeploy", line 147, in __extract__
    subprocess.check_call(cmd)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['tar', '-xhf', '/toolkit_tarballs/base_env-6.2.txz', '-C', '/build_env/ds.braswell-6.2']' returned non-zero exit status 2.

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/pkgscripts-ng/include/python/parallel.py", line 12, in __call__
    result = self.__callable(*args, **kwargs)
  File "pkgscripts-ng/EnvDeploy", line 151, in deploy_base_env
    self.__extract__(base_tarball, BuildEnv.getChrootSynoBase(platform, self.version, self.suffix))
  File "pkgscripts-ng/EnvDeploy", line 147, in __extract__
    subprocess.check_call(cmd)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['tar', '-xhf', '/toolkit_tarballs/base_env-6.2.txz', '-C', '/build_env/ds.braswell-6.2']' returned non-zero exit status 2.
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "pkgscripts-ng/EnvDeploy", line 335, in <module>
    main(sys.argv[1:])
  File "pkgscripts-ng/EnvDeploy", line 329, in main
    ToolkitDeployer(args, platforms, tarball_manager).deploy()
  File "pkgscripts-ng/EnvDeploy", line 236, in deploy
    doPlatformParallel(self.deploy_base_env, self.platforms)
  File "/pkgscripts-ng/include/python/parallel.py", line 57, in doPlatformParallel
    output[item] = results[item].get()
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 644, in get
    raise self._value
subprocess.CalledProcessError: Command '['tar', '-xhf', '/toolkit_tarballs/base_env-6.2.txz', '-C', '/build_env/ds.braswell-6.2']' returned non-zero exit status 2.

DS1815+: iproute2 too old

I've tried using the avoton package on a DS1815+ running DSM 6.2.2. Running wg-quick up fails on setting suppress_prefixlength to 0 on the main IPv6 table:

# wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip address add n.n.n.n dev wg0
[#] ip address add nnnn:nnnn:nnnn:nnnn::nnn/128 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] wg set wg0 fwmark 51820
[#] ip -6 route add ::/0 dev wg0 table 51820
[#] ip -6 rule add not fwmark 51820 table 51820
[#] ip -6 rule add table main suppress_prefixlength 0
Error: argument "suppress_prefixlength" is wrong: Failed to parse rule type
[#] ip -6 rule delete table 51820
[#] ip link delete dev wg0

According to Jason, this is caused by the version of iproute2 being too old:

https://lists.zx2c4.com/pipermail/wireguard/2018-April/002687.html

I don't quite understand how this should be different from 6.2 running on DS1817+ where it supposedly works, but..

AFAICT the kernel should be recent enough, just about:

# uname -a
Linux nasse 3.10.105 #24922 SMP Thu Mar 28 11:04:28 CST 2019 x86_64 GNU/Linux synology_avoton_1815+

But iproute2 is rather old:

# ip -V
ip utility, iproute2-ss130716

What do you reckon would be the best way around this? I tried removing all IPv6 addresses from the config as a test, but it still wants to mess with the prefixlength.

/usr/local/bin/wg-quick: line 32: resolvconf: command not found

Description
I followed the instructions on my DS918+, and when I wanna trigger the wg-quick, it doesn't find resolvconf on my synology.

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

Seems that I can't find resolvconf anywhere on my NAS. How should we install it ?

Will there ever be Armada370/Armada375 support?

Hi!

Couldn't find the question here :). Will there ever be support in the future for the Synology's that are running with the Armada370/Armada375 chipset? Or isn't this possible?

Thank you for your time and keep up the great work, devs!

Encountering error upon launching wg-quick up

Using your directions I am successful in running everything on my diskstation until I hit this message trying to use wg-quick up:

/usr/local/bin/wg-quick: line 31: resolvconf: command not found

This seemed to be a big issue with various ubuntu images, but unlike them I cannot run their fix sudo apt-get install resolvconf.

My unit is a DS1019+, I used your pre-configured apollolake SPK as my platform should be compatible going off the table. Any idea's on how to resolve this?

Dyndns Update

Do you, or does anyone, has a solution to re establish the connection if the IP of an endpoint changes?

Wireguard looks up a DNS endpoint, whenever the wg interfaces goes up. If wg is running and the Remote endpoints IP changes, wg canโ€™t establish a connection anymore.

I know this is how wireguard works on all devices, and there are scripts out there that let you restart the wg interface if a specific peer canโ€™t be reached anymore.... but as another peer still can be connected and can have active traffic to the NAS, a complete restart is a little bit to much.

Does anyone have a smart solution to check the status and reestablish the Connection?

Best regards

Spk installed but nothing

Hello

I installed the spk on my 6.2.2 apollok
But after the install it's nothing happens.. it's just installed but there is no settings or anything else

ds3617xs/Broadwell 6.2 appears to work

Description
So been attempting to get https://github.com/linuxserver/docker-wireguard to work. Through the steps in this repo was able to compile a working Wireguard kernel module.

Can broadwell be added to Readme and releases page?

Paired with LinuxServer.io's Wireguard docker container the Wireguard kernel module is picked up as existing and the container will handle configuration generation of either client or server mode, in a relatively cross platform/standard way. AND handle start/stop stuff through docker rather than custom scheduled scripts. Woot woot.

Compile steps:

ssh user@nas

mkdir /tmp/testcompile
cd /tmp/testcompile 
mkdir artifacts

git clone https://github.com/runfalk/synology-wireguard.git
cd synology-wireguard/
sudo docker build -t synobuild 

docker run --rm --privileged --env PACKAGE_ARCH=broadwell --env DSM_VER=6.2 -v $(pwd)/artifacts:/result_spk synobuild

#install package found in artifacts folder into synology package center

wg-quick up /tmp/testcompile/synology-wireguard/artifacts/config/wg0.conf

Synology NAS model
ds3617xs

wg0.conf

[Interface]
Address = 10.13.13.1
ListenPort = 51820
PrivateKey = <snipped>
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE

[Peer]
PublicKey = <snipped>
AllowedIPs = 10.13.13.2/32

peer1.conf

[Interface]
Address = 10.13.13.2
PrivateKey = <snipped>
ListenPort = 51820
DNS = 10.13.13.1

[Peer]
PublicKey = <snipped>
Endpoint = <snipped>:51820
AllowedIPs = 0.0.0.0/0, ::/0

Tested on no wifi, cell:
image

Issues:

  • When connected, can reach local LAN resources, but not internet. Presumably config issue.
    EDIT: This was caused by DNS server: Setting it to 8.8.8.8 allowed both internal and external traffic to work properly

Compile fails on DS3615xs DSM 6.2.3

Description
Trying to compile on DS3615xs but it fails to create the SPK-file

Steps to reproduce

  1. Installed Docker and Git Server through the Synology GUI interface.
  2. SSH to DS3615xs and run:
sudo -i
cd root
git clone https://github.com/runfalk/synology-wireguard.git
cd synology-wireguard/ 
docker build -t synobuild .

So far everything went fine. But when running the following:

docker run --rm --privileged --env PACKAGE_ARCH=bromolow --env DSM_VER=6.2 -v $(pwd):/result_spk synobuild

I get:

ult_spk synobuild
Cloning into 'pkgscripts-ng'...
Traceback (most recent call last):
  File "/usr/lib/python3.6/urllib/request.py", line 1325, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))
  File "/usr/lib/python3.6/http/client.py", line 1264, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1310, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1259, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.6/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/lib/python3.6/http/client.py", line 976, in send
    self.connect()
  File "/usr/lib/python3.6/http/client.py", line 1417, in connect
    super().connect()
  File "/usr/lib/python3.6/http/client.py", line 948, in connect
    (self.host,self.port), self.timeout, self.source_address)
  File "/usr/lib/python3.6/socket.py", line 724, in create_connection
    raise err
  File "/usr/lib/python3.6/socket.py", line 713, in create_connection
    sock.connect(sa)
TimeoutError: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pkgscripts-ng/EnvDeploy", line 335, in <module>
    main(sys.argv[1:])
  File "pkgscripts-ng/EnvDeploy", line 326, in main
    ToolkitDownloader(args.version, platforms, tarball_manager, args.quiet).download_toolkit()
  File "pkgscripts-ng/EnvDeploy", line 118, in download_toolkit
    if self._test_url_available(url):
  File "pkgscripts-ng/EnvDeploy", line 99, in _test_url_available
    return int(urllib.request.urlopen(url).getcode()) == 200
  File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 564, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 756, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 564, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 756, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 564, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 756, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.6/urllib/request.py", line 564, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 756, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.6/urllib/request.py", line 526, in open
    response = self._open(req, data)
  File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
    '_open', req)
  File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.6/urllib/request.py", line 1368, in https_open
    context=self._context, check_hostname=self._check_hostname)
  File "/usr/lib/python3.6/urllib/request.py", line 1327, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>

Expected behavior
SPK-file is not created in artifacts directory

Synology NAS model
DS3615xs

wg0.conf

haven't reached this far yet

Can't install on DS218+

I just tried to install wireguard on a fresh install of DSM on a 218+ but it just doesn't want to.

root@nas:~# uname -a
Linux nas 4.4.59+ #25426 SMP PREEMPT Wed Jul 8 03:21:29 CST 2020 x86_64 GNU/Linux synology_apollolake_218+

So I downloaded the apollolake package, I tried both the latest 1.0.20200729 and previous 1.0.20200401 but none worked. When I try via DSM, I just have the message "failed to install the package" (the install settings is set on "any publisher") and when I try via the synopkg:

root@nas:~# synopkg install WireGuard-apollolake-1.0.20200729.spk
Failed to install package WireGuard-apollolake-1.0.20200729.spk, error = [263]

The other problem (more related to the NAS itself I think) is that I can't uninstall it:

root@nas:~$ synopkg uninstall WireGuard
Failed to uninstall package: WireGuard, 0

I have to remove all of these in order to do so:

root@nas:~# rm -rf /usr/syno/etc/packages/WireGuard
root@nas:~# rm -rf /var/packages/WireGuard
root@nas:~# rm -rf /var/cache/pkglist.tmp/icon/INST/WireGuard

Rebooting doesn't solve anything and I still have the files wg wg-quick wireguard.ko in /volume1/@appstore/WireGuard/wireguard/. When I try to use wg-quick, I get the message:

RTNETLINK answers: Operation not supported
Unable to access interface: Protocol not supported

Did I miss something?

What is specific to Synology when configuring WireGuard?

I'm following this guide when setting up WireGuard and I have all the tools needed except when I reach

We also want to ensure that the rules remain persistent across reboots.

Specific packages are required here that we don't have available to us as Synology owners. Have you followed a different guide? Did I even need the iptables rules?

No wg0 interface

Hi runfalk,

Thanks for the wg synology package!

I have a synology DS218+ and with DSM 6.2.2 installed.

I have uploaded the apollolake package manually, have ran sudo ip link add wg0 type wireguard and sudo wg which outputs; interface: wg0.

When i look for the wg0 interface nothing is showing.. Am i missing a critical step? Do I need to create the /etc/wireguard/wg0.conf file (which i have done with now luck)?

Sorry if this is a noob question.

DS214+ supported?

I have a DS214+ running Linux 3.2.40, will this work?

Linux FoxStation 3.2.40 #24922 SMP Fri May 10 02:48:25 CST 2019 armv7l GNU/Linux synology_armadaxp_ds214+```

Installation

I have the synology ds 216+II, wondering if this is compatible? i don't see it on the list the kernel verzion is 3.10.105. Looks like it has an Intel Celeron N3060

Upgrade from 1.0.20200401 to 1.0.20200729

Hello, i have Wireguard version 1.0.20200401 on my DS718+. Can I now simply download the package of the new version 1.0.20200729 and then manually upload/update it using the Package Center or will my Configs then be overwritten?
regards

Boardwellnk

Hello,

There is a problem with compile on broadwellnk chip ;/

2020-09-01 16:32:35 (116 KB/s) - 'wireguard-linux-compat-1.0.20200729.tar.xz' saved [262464]

patching file wireguard-linux-compat-1.0.20200729/src/compat/Kbuild.include
Hunk #1 succeeded at 42 with fuzz 2.
make[1]: Entering directory '/source/WireGuard/wireguard-linux-compat-1.0.20200729/src'
In file included from <command-line>:0:0:
/source/WireGuard/wireguard-linux-compat-1.0.20200729/src/compat/memneq/include.h:2:19: error: redefinition of 'crypto_memneq'
 static inline int crypto_memneq(const void *a, const void *b, size_t size)
                   ^
In file included from /source/WireGuard/wireguard-linux-compat-1.0.20200729/src/compat/compat.h:731:0,
                 from <command-line>:0:
include/crypto/algapi.h:380:19: note: previous definition of 'crypto_memneq' was here
 static inline int crypto_memneq(const void *a, const void *b, size_t size)
                   ^
scripts/Makefile.build:269: recipe for target '/source/WireGuard/wireguard-linux-compat-1.0.20200729/src/main.o' failed
make[3]: *** [/source/WireGuard/wireguard-linux-compat-1.0.20200729/src/main.o] Error 1
Makefile:1411: recipe for target '_module_/source/WireGuard/wireguard-linux-compat-1.0.20200729/src' failed
make[2]: *** [_module_/source/WireGuard/wireguard-linux-compat-1.0.20200729/src] Error 2
Makefile:26: recipe for target 'module' failed
make[1]: *** [module] Error 2
make[1]: Leaving directory '/source/WireGuard/wireguard-linux-compat-1.0.20200729/src'
Makefile:64: recipe for target 'wireguard-linux-compat-1.0.20200729/src/wireguard.ko' failed
make: *** [wireguard-linux-compat-1.0.20200729/src/wireguard.ko] Error 2
make: Leaving directory '/source/WireGuard'

[Error] Build project fail!

Time cost: 00:00:29 [Build-->WireGuard]
[INFO] Build WireGuard finished!

----------------- Time cost statistics -----------------
Time cost: 00:00:29 [Build-->WireGuard]

########################################################
      Error(s) occurred on project "WireGuard"
########################################################
1 projects, 1 failed.


[Error] Check [/logs/error.build] for fixing errors.

cat: 
Install log
===========

/build_env/ds.broadwellnk-6.2/logs.install: No such file or director

Connected but no DNS resolving?

Dear guys,
first of all I would like to thank you for putting your efforts in this project. I'm aware that it's kinda discontinued but I'm very interested in it.

In the past as I successfully ran wireguard on my OpenWrt router and I would like to do the same on my NAS.

My configurations files are quite simple and I don't really get why is keeping the client from connecting to the wider internet (ping to local IPs works) :

[wg0.conf]

[Interface]
Address = 10.0.1.1/16
PrivateKey = (hidden)
ListenPort = (hidden)
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth1 -j MASQUERADE

[Peer]
PublicKey = (hidden)
PresharedKey = (hidden)
AllowedIPs = 10.0.1.2/32`

PEER 1

[Interface]
PrivateKey = <PKEY>
Address = 10.0.10.2/24
DNS = 192.168.1.1

[Peer]
PublicKey = <PUBKEY>
PresharedKey = <PSKEY>
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = <LOCAL_IP>:<PORT>
PersistentKeepalive = 25
![image](https://user-images.githubusercontent.com/11884948/70932229-e4189200-2041-11ea-9698-81c4842cbb9c.png)
root@DNS-NAS:/etc/wireguard# wg
interface: wg0
  public key: <PUBKEY>
  private key: (hidden)
  listening port: <PORT>

peer: <HIDDEN>
  preshared key: (hidden)
  endpoint: 192.168.1.161:62341
  allowed ips: 10.0.1.2/32
  latest handshake: 4 seconds ago
  transfer: 1.74 KiB received, 1.43 KiB sent

Any suggestions?
My idea is that DNS queries are currently not being resolved.
Thanks!

Kernel module doesn't seem to load on DS1621+ (v1000 arch)

Description
I'm attempting to install and use on a DS1621+. I have managed to build the .spk using the v1000 arch (using the fix here #48 (comment) ), and it seems to install ok, but I don't think the kernel module is being loaded.

When I run dmesg I see this line:

[599058.301294] wireguard: version magic '4.4.59+ SMP preempt mod_unload ' should be '4.4.59+ SMP mod_unload '

Whenever I reinstall the .spk.

Expected behavior
The kernel module to load.

Synology NAS model
DS1621+

Unable to launch WireGuard

Description
Hello,

I tried to install the WireGuard package but it failed. I tried to uninstall it but it failed too. I'd be very grateful if someone could help me to install it, or at least to delete it until a newer version will be released. Thanks for your help !

Synology NAS model
DS718+
DSM 6.2.3
Package : WireGuard-apollolake-1.0.20200401.spk

Capture dโ€™eฬcran 2020-04-23 aฬ€ 09 41 47

Capture dโ€™eฬcran 2020-04-23 aฬ€ 09 42 36

Cross compiling for DS418

Hi, I'm compiling wireguard from x86_64 arch for my DS418 and it fails. The error log:

patching file WireGuard-0.0.20190227/src/compat/Kbuild.include
make[1]: Entering directory '/source/WireGuard/WireGuard-0.0.20190227/src/tools'
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/wg.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/config.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/show.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/mnlg.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/terminal.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/ipc.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/encoding.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/curve25519.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/setconf.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/genkey.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/showconf.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/pubkey.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/set.o
  LD      /source/WireGuard/WireGuard-0.0.20190227/src/tools/wg
make[1]: Leaving directory '/source/WireGuard/WireGuard-0.0.20190227/src/tools'
make[1]: Entering directory '/source/WireGuard/WireGuard-0.0.20190227/src'
In file included from <command-line>:0:0:
/source/WireGuard/WireGuard-0.0.20190227/src/compat/memneq/include.h:2:19: error: redefinition of 'crypto_memneq'
 static inline int crypto_memneq(const void *a, const void *b, size_t size)
                   ^
In file included from /source/WireGuard/WireGuard-0.0.20190227/src/compat/compat.h:716:0,
                 from <command-line>:0:
include/crypto/algapi.h:380:19: note: previous definition of 'crypto_memneq' was here
 static inline int crypto_memneq(const void *a, const void *b, size_t size)
                   ^
scripts/Makefile.build:269: recipe for target '/source/WireGuard/WireGuard-0.0.20190227/src/main.o' failed
make[3]: *** [/source/WireGuard/WireGuard-0.0.20190227/src/main.o] Error 1
Makefile:1411: recipe for target '_module_/source/WireGuard/WireGuard-0.0.20190227/src' failed
make[2]: *** [_module_/source/WireGuard/WireGuard-0.0.20190227/src] Error 2
Makefile:37: recipe for target 'module' failed
make[1]: *** [module] Error 2
make[1]: Leaving directory '/source/WireGuard/WireGuard-0.0.20190227/src'
Makefile:57: recipe for target 'WireGuard-0.0.20190227/src/wireguard.ko' failed
make: *** [WireGuard-0.0.20190227/src/wireguard.ko] Error 2
make: Leaving directory '/source/WireGuard'

[Error] Build project fail!


----------------- Time cost statistics -----------------
Time cost: 00:00:14 [Build-->WireGuard]
[INFO] Build WireGuard finished!
Time cost: 00:00:14 [Build-->WireGuard]

########################################################
      Error(s) occurred on project "WireGuard"
########################################################
1 projects, 1 failed.


[Error] Check [/logs/error.build] for fixing errors.




############################################################
                  Failed to build package.
############################################################
Failed to build package. [rtd1296] : WireGuard
Error log: /build_env/ds.rtd1296-6.2/logs.build


BuildPackageError:
Failed to build package.

[ERROR] pkgscripts-ng/PkgCreate.py -p rtd1296 -v 6.2 -S --build-opt=-J --print-log -c WireGuard failed!
Build log
=========
Set cache size limit to 3.0 Gbytes
Statistics cleared
rm: cannot remove '/env32.mak': No such file or directory
rm: cannot remove '/env64.mak': No such file or directory
[INFO] projectList="WireGuard"
[INFO] Start to build WireGuard.
[SCRIPT] build script: //source/WireGuard/SynoBuildConf/build
[INFO] ======= Run build script =======
rm -rf libmnl-1.0.4.tar.bz2 libmnl-1.0.4 WireGuard-0.0.20190227.tar.xz WireGuard-0.0.20190227
make: Entering directory '/source/WireGuard'
--2019-07-15 22:31:44--  https://netfilter.org/projects/libmnl/files/libmnl-1.0.4.tar.bz2
Resolving netfilter.org (netfilter.org)... 150.214.142.167
Connecting to netfilter.org (netfilter.org)|150.214.142.167|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 301270 (294K) [application/x-bzip2]
Saving to: 'libmnl-1.0.4.tar.bz2'

     0K .......... .......... .......... .......... .......... 16%  451K 1s
    50K .......... .......... .......... .......... .......... 33%  930K 0s
   100K .......... .......... .......... .......... .......... 50% 22.6M 0s
   150K .......... .......... .......... .......... .......... 67% 28.6M 0s
   200K .......... .......... .......... .......... .......... 84%  963K 0s
   250K .......... .......... .......... .......... ....      100% 31.2M=0.2s

2019-07-15 22:31:44 (1.30 MB/s) - 'libmnl-1.0.4.tar.bz2' saved [301270/301270]

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for x86_64-unknown-linux-gnu-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking for x86_64-unknown-linux-gnu-gcc... /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc accepts -g... yes
checking for /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc option to accept ISO C89... none needed
checking whether /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc... gcc3
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc... /usr/local/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/bin/ld
checking if the linker (/usr/local/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/local/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/bin/ld option to reload object files... -r
checking for x86_64-unknown-linux-gnu-objdump... no
checking for objdump... objdump
configure: WARNING: using cross tools not prefixed with host triplet
checking how to recognize dependent libraries... pass_all
checking for x86_64-unknown-linux-gnu-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for x86_64-unknown-linux-gnu-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for x86_64-unknown-linux-gnu-strip... strip
checking for x86_64-unknown-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc object... ok
checking for sysroot... no
checking for x86_64-unknown-linux-gnu-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc supports -fno-rtti -fno-exceptions... no
checking for /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc option to produce PIC... -fPIC -DPIC
checking if /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc PIC flag -fPIC -DPIC works... yes
checking if /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc static flag -static works... yes
checking if /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc supports -c -o file.o... yes
checking if /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc supports -c -o file.o... (cached) yes
checking whether the /usr/local/aarch64-unknown-linux-gnueabi/bin/aarch64-unknown-linux-gnueabi-gcc linker (/usr/local/aarch64-unknown-linux-gnueabi/aarch64-unknown-linux-gnueabi/bin/ld -m elf_x86_64) supports shared libraries... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... unsupported
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether compiler accepts -fvisibility=hidden... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating include/Makefile
config.status: creating include/libmnl/Makefile
config.status: creating include/linux/Makefile
config.status: creating include/linux/netfilter/Makefile
config.status: creating examples/Makefile
config.status: creating examples/genl/Makefile
config.status: creating examples/kobject/Makefile
config.status: creating examples/netfilter/Makefile
config.status: creating examples/rtnl/Makefile
config.status: creating libmnl.pc
config.status: creating doxygen.cfg
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
make[1]: Entering directory '/source/WireGuard/libmnl-1.0.4'
make[2]: Entering directory '/source/WireGuard/libmnl-1.0.4'
Making all in src
make[3]: Entering directory '/source/WireGuard/libmnl-1.0.4/src'
  CC       socket.lo
  CC       callback.lo
  CC       nlmsg.lo
  CC       attr.lo
  CCLD     libmnl.la
make[3]: Leaving directory '/source/WireGuard/libmnl-1.0.4/src'
Making all in include
make[3]: Entering directory '/source/WireGuard/libmnl-1.0.4/include'
Making all in libmnl
Making all in linux
make[4]: Entering directory '/source/WireGuard/libmnl-1.0.4/include/linux'
Making all in netfilter
make[4]: Leaving directory '/source/WireGuard/libmnl-1.0.4/include/linux'
make[3]: Leaving directory '/source/WireGuard/libmnl-1.0.4/include'
Making all in examples
make[3]: Entering directory '/source/WireGuard/libmnl-1.0.4/examples'
Making all in genl
Making all in kobject
Making all in netfilter
Making all in rtnl
make[3]: Leaving directory '/source/WireGuard/libmnl-1.0.4/examples'
make[3]: Entering directory '/source/WireGuard/libmnl-1.0.4'
make[3]: Leaving directory '/source/WireGuard/libmnl-1.0.4'
make[2]: Leaving directory '/source/WireGuard/libmnl-1.0.4'
make[1]: Leaving directory '/source/WireGuard/libmnl-1.0.4'
--2019-07-15 22:31:49--  https://git.zx2c4.com/WireGuard/snapshot/WireGuard-0.0.20190227.tar.xz
Resolving git.zx2c4.com (git.zx2c4.com)... 147.75.77.251, 2604:1380:1:4d00::3
Connecting to git.zx2c4.com (git.zx2c4.com)|147.75.77.251|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-xz]
Saving to: 'WireGuard-0.0.20190227.tar.xz'

     0K .......... .......... .......... .......... ..........  303K
    50K .......... .......... .......... .......... ..........  643K
   100K .......... .......... .......... .......... ..........  238K
   150K .......... .......... .......... .......... ..........  103K
   200K .......... .......... .......... .......... ..........  190K
   250K .......... .......... .......... .......... ..........  640K
   300K .......... ......                                      2.23M=1.3s

2019-07-15 22:31:51 (246 KB/s) - 'WireGuard-0.0.20190227.tar.xz' saved [323788]

patching file WireGuard-0.0.20190227/src/compat/Kbuild.include
make[1]: Entering directory '/source/WireGuard/WireGuard-0.0.20190227/src/tools'
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/wg.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/config.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/show.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/mnlg.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/terminal.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/ipc.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/encoding.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/curve25519.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/setconf.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/genkey.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/showconf.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/pubkey.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/set.o
  LD      /source/WireGuard/WireGuard-0.0.20190227/src/tools/wg
make[1]: Leaving directory '/source/WireGuard/WireGuard-0.0.20190227/src/tools'
make[1]: Entering directory '/source/WireGuard/WireGuard-0.0.20190227/src'
In file included from <command-line>:0:0:
/source/WireGuard/WireGuard-0.0.20190227/src/compat/memneq/include.h:2:19: error: redefinition of 'crypto_memneq'
 static inline int crypto_memneq(const void *a, const void *b, size_t size)
                   ^
In file included from /source/WireGuard/WireGuard-0.0.20190227/src/compat/compat.h:716:0,
                 from <command-line>:0:
include/crypto/algapi.h:380:19: note: previous definition of 'crypto_memneq' was here
 static inline int crypto_memneq(const void *a, const void *b, size_t size)
                   ^
scripts/Makefile.build:269: recipe for target '/source/WireGuard/WireGuard-0.0.20190227/src/main.o' failed
make[3]: *** [/source/WireGuard/WireGuard-0.0.20190227/src/main.o] Error 1
Makefile:1411: recipe for target '_module_/source/WireGuard/WireGuard-0.0.20190227/src' failed
make[2]: *** [_module_/source/WireGuard/WireGuard-0.0.20190227/src] Error 2
Makefile:37: recipe for target 'module' failed
make[1]: *** [module] Error 2
make[1]: Leaving directory '/source/WireGuard/WireGuard-0.0.20190227/src'
Makefile:57: recipe for target 'WireGuard-0.0.20190227/src/wireguard.ko' failed
make: *** [WireGuard-0.0.20190227/src/wireguard.ko] Error 2
make: Leaving directory '/source/WireGuard'

[Error] Build project fail!


----------------- Time cost statistics -----------------
Time cost: 00:00:14 [Build-->WireGuard]
[INFO] Build WireGuard finished!
Time cost: 00:00:14 [Build-->WireGuard]

########################################################
      Error(s) occurred on project "WireGuard"
########################################################
1 projects, 1 failed.


[Error] Check [/logs/error.build] for fixing errors.


Install log
===========
cat: /build_env/ds.rtd1296-6.2/logs.install: No such file or directory

My compile command:

$ sudo docker run --rm --privileged --env PACKAGE_ARCH=rtd1296 --env DSM_VER=6.2 -v $(pwd)/artifacts:/result_spk synobuild

My model info:

Model: DS418
CPU: Realtek RTD1296 SoC
DSM: DSM 6.2.2-24922 Update 2
$ uname -a
Linux HomeNAS 4.4.59+ #24922 SMP Wed Jul 3 16:36:23 CST 2019 aarch64 GNU/Linux synology_rtd1296_ds418
$ cat /proc/cpuinfo

processor       : 0
model name      : ARMv8 Processor rev 4 (v8l)
BogoMIPS        : 54.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
model name      : ARMv8 Processor rev 4 (v8l)
BogoMIPS        : 54.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
model name      : ARMv8 Processor rev 4 (v8l)
BogoMIPS        : 54.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
model name      : ARMv8 Processor rev 4 (v8l)
BogoMIPS        : 54.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Thanks for any help!

Upgrading wireguard version

Hello,

What is the correct way to upgrade to a newer wireguard version and compile the package indicating that version?

Best Regards,
Antoniy

Unable to start Wireguard tunnel

Description
Thank you for your work on this package!
Setting up WG on Synology NAS as a client. See client conf below.
Package installs fine. Service is up and running.
Unable to start Wireguard tunnel using the commands in the documentation.
Error message is "iptables-restore v1.6.0: iptables-restore: unable to initialize table 'raw'"

DS1618+
DSM 6.2
synology-wireguard release 1.0.20200401

Steps to reproduce

$ ssh user@nas
$ sudo wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 10.6.0.6/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] wg set wg0 fwmark 51820
[#] ip -4 route add 0.0.0.0/0 dev wg0 table 51820
[#] ip -4 rule add not fwmark 51820 table 51820
[#] ip -4 rule add table main suppress_prefixlength 0
[#] sysctl -q net.ipv4.conf.all.src_valid_mark=1
[#] iptables-restore -n
iptables-restore v1.6.0: iptables-restore: unable to initialize table 'raw'

Error occurred at line: 1
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
[#] ip -4 rule delete table 51820
[#] ip -4 rule delete table main suppress_prefixlength 0
[#] ip link delete dev wg0

Expected behavior
Expected successful activation of wg0 tunnel. The iptables-save error prevents that.

Synology NAS model
DS1618+

wg0.conf

[Interface]
PrivateKey = [REDACTED]
Address = 10.6.0.6/24


[Peer]
PublicKey = [REDACTED]
PresharedKey = [REDACTED]
Endpoint = [REDACTED]:51820
AllowedIPs = 0.0.0.0/0

log messages at the time of sudo wg-quick up wg0

2020-05-27T17:46:26-05:00 GenericNASName synonetd: base_hook.cpp:74 Hook environment is not valid
2020-05-27T17:46:27-05:00 GenericNASName ipv4_change hook event: wg0 none->10.6.0.6 
2020-05-27T17:46:27-05:00 GenericNASName if_link_up hook event: wg0 
2020-05-27T17:46:27-05:00 GenericNASName if_link_down hook event: wg0 
2020-05-27T17:46:27-05:00 GenericNASName ipv4_change hook event: wg0 10.6.0.6->none 
2020-05-27T17:46:28-05:00 GenericNASName [11535.969217] init: scsi_plugin_server main process (17639) killed by TERM signal
2020-05-27T17:46:28-05:00 GenericNASName [11535.992032] init: iscsi_pluginserverd main process (20308) killed by TERM signal
2020-05-27T17:46:28-05:00 GenericNASName [11536.005412] init: iscsi_pluginengined main process (20298) killed by TERM signal
2020-05-27T17:46:28-05:00 GenericNASName [11536.047433] init: scsi_plugin_server main process (20313) killed by TERM signal
2020-05-27T17:46:28-05:00 GenericNASName [11536.515917] init: nmbd main process (20432) killed by TERM signal
2020-05-27T17:46:30-05:00 GenericNASName [11538.725168] init: iscsi_pluginserverd main process (20330) killed by TERM signal
2020-05-27T17:46:30-05:00 GenericNASName [11538.733989] init: iscsi_pluginengined main process (20327) killed by TERM signal
2020-05-27T17:46:30-05:00 GenericNASName [11538.757394] init: scsi_plugin_server main process (20334) killed by TERM signal
2020-05-27T17:46:31-05:00 GenericNASName [11538.983189] init: iscsi_pluginserverd main process (20962) killed by TERM signal
2020-05-27T17:46:31-05:00 GenericNASName [11538.991977] init: iscsi_pluginengined main process (20961) killed by TERM signal
2020-05-27T17:46:31-05:00 GenericNASName [11539.015945] init: scsi_plugin_server main process (20964) killed by TERM signal

As a side note: I'm concerned that the wireguard stop may be killing the scsi processes when it winds down after the error.

Wireguard kernel module and Docker

Hi,

I have installed the Wireguard package on my Synology DS920+, all is working.
I also have docker where I run different containers, one of the is qBittorent VPN, now running with OpenVPN but since the last version it supports Wireguard but therefore the Wireguard kernel needed to be installed on the host OS, I suppose with installing this package this was done, however still getting this error "could not detect a useable init system"

Any idea?

Add Geminilake Platform

Description
Compile for DS920+ (Geminilake)

Steps to reproduce

git clone https://github.com/runfalk/synology-wireguard.git
cd synology-wireguard/
sudo docker build -t synobuild .
sudo docker run --rm --privileged --env PACKAGE_ARCH=geminilake --env DSM_VER=6.2 -v $(pwd)/artifacts:/result_spk synobuild

Output

Cloning into 'pkgscripts-ng'...

PlatformNotAvailableError:
[Geminilake] is not available platform.

Expected behavior
Compiled SPK

Synology NAS model
DS920+

Support for Synology Router SRM

Hi Andreas, your work is really great!
But it would be even more useful if you could somehow create a .spk for SRM as well.

Best regards,
Keep up the good work!

WG20190702 SPK fails to install on DS218Play

From my point of view, it's related to postinst script, the bin path is not correct: /usr/local/bin instead of /usr/bin

Workaround: create a symbolic link for /usr/local/bin

No access to local devices

Hello

My DS718+ have the IP 192.168.99.23 (Network Bond) and the firewall is inactive.
Router: 192.168.99.1
PiHole: 192.168.99.46

root@DS718:/etc/wireguard# ifconfig
bond0     Link encap:Ethernet  HWaddr 00:11:32:B5:AD:9B  
          inet addr:192.168.99.23  Bcast:192.168.99.255  Mask:255.255.255.0
          inet6 addr: fe80::211:32ff:feb5:ad9b/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:363502 errors:0 dropped:0 overruns:0 frame:0
          TX packets:293497 errors:0 dropped:4 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:171938183 (163.9 MiB)  TX bytes:261313323 (249.2 MiB)

eth0      Link encap:Ethernet  HWaddr 00:11:32:B5:AD:9B  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:17723 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10139 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:5262002 (5.0 MiB)  TX bytes:1849850 (1.7 MiB)

eth1      Link encap:Ethernet  HWaddr 00:11:32:B5:AD:9B  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:345779 errors:0 dropped:0 overruns:0 frame:0
          TX packets:283358 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:166676181 (158.9 MiB)  TX bytes:259463473 (247.4 MiB)

This is my wg0.conf (SERVER)

[Interface]
Address = 192.168.88.1/24
SaveConfig = true
PostUp = sysctl -w net.ipv4.ip_forward=1
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o bond0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o bond0 -j MASQUERADE
ListenPort = PORT
PrivateKey = PRIVATE-KEY

I don't know is the PostUp with "-o bond0" correctly?

And on my iPhone i have this settings.

INTERFACE
PublicKey: PUBLIC-KEY-CLIENT
Addresses: 192.168.88.2/24
DNS servers: 192.168.99.1

PEER
PublicKey: PUBLIC-KEY-SERVER
Endpoint: MY-DYNDNS:PORT
Persistent keepalive: 15

I can connect to the server with my iPhone. Websites like Google are also displayed correctly, but when I try to connect to my NAS 192.168.99.23:5000 this does not work. Do you have to set something somewhere so that the access from 192.168.88.x to 192.168.99.x works? Or is my DNS setting wrong?

regrads
Roger

Synology DSM 6.2.2-24922 breaking WireGuard?

Two days ago my NAS restarted and upgraded to 6.2.2-24922 (from 6.2.1-23824-6) by itself. Since then I can no longer connect using WireGuard.

Changelog doesn't seem to list anything obvious (https://www.synology.com/en-global/releaseNote/DS218j#ver_24922). My kernel compile is fresh, but the version is the same Linux Poseidon 3.10.105 #24922 SMP Fri May 10 02:48:35 CST 2019 armv7l GNU/Linux synology_armada38x_ds218j.

Does anyone else experience the same?

[Solution] working DNS for a default (Router->Nas) server/client use case.

Description
I could not get the tunnel to work with the given examples/documentation. We want to access our LAN's NAS/Samba + other services (Docker stuff) from external Windows/MacOS clients and Android Phones (4g).

Synology NAS model
DS415+ (DSM 6.2.2)

wg0.conf

[Interface]
Address = 10.0.10.1/24
ListenPort = 56111
PrivateKey = ***********
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
PublicKey = ***********
AllowedIPs = 10.0.10.201/32

If there are multiple peers, include their configuration too.

[Interface]
PrivateKey = ***********
Address = 10.0.10.201/32

[Peer]
PublicKey = ***********
AllowedIPs = 10.0.10.0/24
Endpoint = *****:56111

NOTE: The NAS is behind a router (fritz.box/192.168.178.1) and udp port 56111 is forwarded to the NAS ip 192.168.178.2.

With this default configuration from the github page, i could not ping any tunnel endpoint from either side (10.0.10.1), but the wireguard connection was established, wg show had established handshake.

Here is what actually worked for this setup:
wg0.conf

[Interface]
Address = 10.0.10.1/24
ListenPort = 56111
PrivateKey = ***********
Table = off
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE; sleep 5; ip route add 10.0.10.0/24 dev wg0
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
[Peer]
PublicKey = ***********
AllowedIPs = 10.0.10.201/32

Client Config (Windows10 + local DNS at 192.168.1.1):

[Interface]
PrivateKey = ***********
Address = 10.0.10.201/32
DNS = 192.168.1.1, 192.168.178.1
[Peer]
PublicKey = ***********
AllowedIPs = 10.0.10.0/24, 192.168.178.0/24
Endpoint = *****:56111

This way everything works as expected and we can use both LAN's DNS servers, but you have to use the FQDN aka server.fritz.box (192.168.178.2) vs router.lan (192.168.1.1).

The biggest puzzle piece was the missing route entry "sleep 5; ip route add 10.0.10.0/24 dev wg0" without the extra entry and the timeout i could not get anything to work.

PS: Also make sure you actually use ping on your termux android phone, termux by default will use a special internal DNS via 3/4g and nslookup will fail, while pings resolve correctly!

Build failed for apollolake DS218+

Tried to build this on a DS218+ in a Docker container for itself. All I'm doing differently from your instructions is swapping your processor target for my own.

root@764bd8649e25:/# pkgscripts-ng/PkgCreate.py -p apollolake -v 6.2 -S --build-opt=-J --print-log -c WireGuard

============================================================
                   Parse argument result                    
------------------------------------------------------------
env_section  : default
env_version  : 6.2
dep_level    : 1
branch       : master
suffix       : 
collect      : True
update       : True
link         : True
build        : True
install      : True
only_install : False
sign         : False
build_opt    : -J
install_opt  : 
print_log    : True
sdk_ver      : 6.0
package      : WireGuard

Processing [6.2-23739]: apollolake

============================================================
              Start to run "Traverse project"               
------------------------------------------------------------
[INFO] Branch projects: WireGuard
[INFO] Tag projects: 
[INFO] Reference projects: 
[INFO] Reference tag projects: 

============================================================
                Start to run "Link Project"                 
------------------------------------------------------------
Link /pkgscripts-ng -> /build_env/ds.apollolake-6.2/pkgscripts-ng
Link //source/WireGuard -> /build_env/ds.apollolake-6.2/source/WireGuard

============================================================
                Start to run "Build Package"                
------------------------------------------------------------
[apollolake] set -o pipefail; env PackageName=WireGuard /pkgscripts-ng/SynoBuild --apollolake -c --min-sdk 6.0 -J WireGuard 2>&1 | tee logs.build

############################################################
          /build_env/ds.apollolake-6.2/logs.build           
############################################################
Set cache size limit to 3.0 Gbytes
Statistics cleared
rm: cannot remove '/env32.mak': No such file or directory
rm: cannot remove '/env64.mak': No such file or directory
[INFO] projectList="WireGuard"
[INFO] Start to build WireGuard.
[SCRIPT] build script: //source/WireGuard/SynoBuildConf/build
[INFO] ======= Run build script =======
rm -rf libmnl-1.0.4.tar.bz2 libmnl-1.0.4 WireGuard-0.0.20190227.tar.xz WireGuard-0.0.20190227
make: Entering directory '/source/WireGuard'
--2019-03-21 02:14:46--  https://netfilter.org/projects/libmnl/files/libmnl-1.0.4.tar.bz2
Resolving netfilter.org (netfilter.org)... 150.214.142.167
Connecting to netfilter.org (netfilter.org)|150.214.142.167|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 301270 (294K) [application/x-bzip2]
Saving to: 'libmnl-1.0.4.tar.bz2'

     0K .......... .......... .......... .......... .......... 16%  400K 1s
    50K .......... .......... .......... .......... .......... 33%  821K 0s
   100K .......... .......... .......... .......... .......... 50% 11.4M 0s
   150K .......... .......... .......... .......... .......... 67% 1.55M 0s
   200K .......... .......... .......... .......... .......... 84% 1.49M 0s
   250K .......... .......... .......... .......... ....      100% 44.1M=0.3s

2019-03-21 02:14:46 (1.12 MB/s) - 'libmnl-1.0.4.tar.bz2' saved [301270/301270]

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for x86_64-unknown-linux-gnu-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking how to create a pax tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking for x86_64-unknown-linux-gnu-gcc... /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc accepts -g... yes
checking for /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc option to accept ISO C89... none needed
checking whether /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc... gcc3
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc... /usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/bin/ld
checking if the linker (/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/bin/ld option to reload object files... -r
checking for x86_64-unknown-linux-gnu-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for x86_64-unknown-linux-gnu-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for x86_64-unknown-linux-gnu-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for x86_64-unknown-linux-gnu-strip... strip
checking for x86_64-unknown-linux-gnu-ranlib... no
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc object... ok
checking for sysroot... no
checking for x86_64-unknown-linux-gnu-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc supports -fno-rtti -fno-exceptions... no
checking for /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc option to produce PIC... -fPIC -DPIC
checking if /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc PIC flag -fPIC -DPIC works... yes
checking if /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc static flag -static works... yes
checking if /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc supports -c -o file.o... yes
checking if /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc supports -c -o file.o... (cached) yes
checking whether the /usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu-gcc linker (/usr/local/x86_64-pc-linux-gnu/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking whether compiler accepts -fvisibility=hidden... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating include/Makefile
config.status: creating include/libmnl/Makefile
config.status: creating include/linux/Makefile
config.status: creating include/linux/netfilter/Makefile
config.status: creating examples/Makefile
config.status: creating examples/genl/Makefile
config.status: creating examples/kobject/Makefile
config.status: creating examples/netfilter/Makefile
config.status: creating examples/rtnl/Makefile
config.status: creating libmnl.pc
config.status: creating doxygen.cfg
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
make[1]: Entering directory '/source/WireGuard/libmnl-1.0.4'
make[2]: Entering directory '/source/WireGuard/libmnl-1.0.4'
Making all in src
make[3]: Entering directory '/source/WireGuard/libmnl-1.0.4/src'
  CC       socket.lo
  CC       callback.lo
  CC       nlmsg.lo
  CC       attr.lo
  CCLD     libmnl.la
make[3]: Leaving directory '/source/WireGuard/libmnl-1.0.4/src'
Making all in include
make[3]: Entering directory '/source/WireGuard/libmnl-1.0.4/include'
Making all in libmnl
Making all in linux
make[4]: Entering directory '/source/WireGuard/libmnl-1.0.4/include/linux'
Making all in netfilter
make[4]: Leaving directory '/source/WireGuard/libmnl-1.0.4/include/linux'
make[3]: Leaving directory '/source/WireGuard/libmnl-1.0.4/include'
Making all in examples
make[3]: Entering directory '/source/WireGuard/libmnl-1.0.4/examples'
Making all in genl
Making all in kobject
Making all in netfilter
Making all in rtnl
make[3]: Leaving directory '/source/WireGuard/libmnl-1.0.4/examples'
make[3]: Entering directory '/source/WireGuard/libmnl-1.0.4'
make[3]: Leaving directory '/source/WireGuard/libmnl-1.0.4'
make[2]: Leaving directory '/source/WireGuard/libmnl-1.0.4'
make[1]: Leaving directory '/source/WireGuard/libmnl-1.0.4'
--2019-03-21 02:14:53--  https://git.zx2c4.com/WireGuard/snapshot/WireGuard-0.0.20190227.tar.xz
Resolving git.zx2c4.com (git.zx2c4.com)... 192.95.5.69, 2607:5300:61:14f::c05f:545
Connecting to git.zx2c4.com (git.zx2c4.com)|192.95.5.69|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-xz]
Saving to: 'WireGuard-0.0.20190227.tar.xz'

     0K .......... .......... .......... .......... ..........  428K
    50K .......... .......... .......... .......... ..........  439K
   100K .......... .......... .......... .......... .......... 87.9M
   150K .......... .......... .......... .......... ..........  626K
   200K .......... .......... .......... .......... .......... 1.26M
   250K .......... .......... .......... .......... .......... 1.58M
   300K .......... ......                                      1.59M=0.4s

2019-03-21 02:14:55 (809 KB/s) - 'WireGuard-0.0.20190227.tar.xz' saved [323788]

patching file WireGuard-0.0.20190227/src/compat/Kbuild.include
make[1]: Entering directory '/source/WireGuard/WireGuard-0.0.20190227/src/tools'
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/wg.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/show.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/config.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/terminal.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/ipc.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/encoding.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/curve25519.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/setconf.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/genkey.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/showconf.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/pubkey.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/mnlg.o
  CC      /source/WireGuard/WireGuard-0.0.20190227/src/tools/set.o
  LD      /source/WireGuard/WireGuard-0.0.20190227/src/tools/wg
make[1]: Leaving directory '/source/WireGuard/WireGuard-0.0.20190227/src/tools'
make[1]: Entering directory '/source/WireGuard/WireGuard-0.0.20190227/src'
In file included from <command-line>:0:0:
/source/WireGuard/WireGuard-0.0.20190227/src/compat/memneq/include.h:2:19: error: redefinition of 'crypto_memneq'
 static inline int crypto_memneq(const void *a, const void *b, size_t size)
                   ^
In file included from /source/WireGuard/WireGuard-0.0.20190227/src/compat/compat.h:716:0,
                 from <command-line>:0:
include/crypto/algapi.h:380:19: note: previous definition of 'crypto_memneq' was here
 static inline int crypto_memneq(const void *a, const void *b, size_t size)
                   ^
scripts/Makefile.build:269: recipe for target '/source/WireGuard/WireGuard-0.0.20190227/src/main.o' failed
make[3]: *** [/source/WireGuard/WireGuard-0.0.20190227/src/main.o] Error 1
Makefile:1411: recipe for target '_module_/source/WireGuard/WireGuard-0.0.20190227/src' failed
make[2]: *** [_module_/source/WireGuard/WireGuard-0.0.20190227/src] Error 2
Makefile:37: recipe for target 'module' failed
make[1]: *** [module] Error 2
make[1]: Leaving directory '/source/WireGuard/WireGuard-0.0.20190227/src'
Makefile:54: recipe for target 'WireGuard-0.0.20190227/src/wireguard.ko' failed
make: *** [WireGuard-0.0.20190227/src/wireguard.ko] Error 2
make: Leaving directory '/source/WireGuard'

[Error] Build project fail!

Time cost: 00:00:16 [Build-->WireGuard]
[INFO] Build WireGuard finished!

----------------- Time cost statistics -----------------
Time cost: 00:00:16 [Build-->WireGuard]

########################################################
      Error(s) occurred on project "WireGuard"
########################################################
1 projects, 1 failed.


[Error] Check [/logs/error.build] for fixing errors.




############################################################
                  Failed to build package.                  
############################################################
Failed to build package. [apollolake] : WireGuard
Error log: /build_env/ds.apollolake-6.2/logs.build


BuildPackageError:
Failed to build package.

[ERROR] pkgscripts-ng/PkgCreate.py -p apollolake -v 6.2 -S --build-opt=-J --print-log -c WireGuard failed!

Unable to resolve server vpn

HI,
i have installed on DS1515+ and works well except for one thing

My NAS have this ip
192.168.3.40

This is the /etc/wireguard/wg0.conf

[Interface]
Address = 192.168.3.200/24
PrivateKey = myprivatekey
ListenPort = 16666
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -t nat -A POSTROUTING -o bond0 -j MASQUERADE
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -t nat -D POSTROUTING -o bond0 -j MASQUERADE

[Peer]

macOS client

PublicKey = publickey
PresharedKey = preshared
AllowedIPs = 192.168.3.201/32

#wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip address add 192.168.3.200/24 dev wg0
[#] ip link set mtu 1420 up dev wg0
[#] ip route add 192.168.3.202/32 dev wg0
[#] ip route add 192.168.3.201/32 dev wg0
[#] iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o bond0 -j MASQUERADE

VPN start and working
but if I ping mynas.publicip.com it resolve as 192.168.3.40 and doesn't works.
if I ping 192.168.3.200 it works. (but I use https with name so I need it resolve as 3.40).

May some one which is the problem?
Thanks

How do I tell if the NAS is using the WireGuard connection?

Description
I followed the instructions in the readme, but I have no idea how to tell if it actually stuck. What can I do to check?

Expected behavior
Some way to know if the WireGuard connection is running correctly.

Synology NAS model
DS218+

wg0.conf

[Interface]
PrivateKey = 
Address = 10.19.49.7/24 ,fd9d:bc11:4021::7/48
DNS =  172.16.102.174, fd00::66ae

[Peer]
PublicKey = 
PresharedKey = 
AllowedIPs = 0.0.0.0/0,::/0
Endpoint = 138.197.199.252:51820

If there are multiple peers, include their configuration too.

Synology DS916+

My Synology was not listed among the supported/unsupported devices so maybe you can help me figure out if this will work.

Model: DS916+
Processor: INTEL Pentium N3710
DSM Version: DSM 6.2.1-23824 Update 6

Additional information:

$ uname -a
Linux box 3.10.105 #23824 SMP Tue Feb 12 16:50:45 CST 2019 x86_64 GNU/Linux synology_braswell_916+

$ cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 76
model name	: Intel(R) Pentium(R) CPU  N3710  @ 1.60GHz
stepping	: 4
microcode	: 0x404
cpu MHz		: 1601.000
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes rdrand lahf_lm 3dnowprefetch ida arat epb invpcid_single tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms
bogomips	: 3199.90
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

Thanks in advance :-)

Support for VirtualDSM

Description
Hello,
i wanted to install this promising package onto my VirtualDSM (BareMetal Host is a DS918+).
my use case: i use my VirtualDSM to connect to VPN as i don't want my physical NAS connected on any VPN.

Installation fail on the VirtualDSM with "this package is not supported on the platform of VirtualDSM" with package
WireGuard-apollolake-1.0.20200729.spk
or
WireGuard-x86-1.0.20200729.spk (it may be normal, but i saw x86 and told myself "why not ?")

image

EDIT: I'm not sure, but it seems that the VirtualDSM arch is kvmx64.

i am not a dev at all, but i'm willing to help if you need a labrat/tester ๐Ÿ‘
Thanks a lot for your time ! :)

NB: it's not urgent at all, i'm just really intersted in this package !

Synology NAS model
VirtualDSM (Host is a DS918+)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.