runfalk / synology-wireguard

WireGuard support for some Synology NAS drives
MIT License
945 stars 132 forks source link

ds3617xs/Broadwell 6.2 appears to work #44

Closed iyerusad closed 4 years ago

iyerusad commented 4 years ago

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: