runfalk / synology-wireguard

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

Unable to start Wireguard in DSM 7.1.1-42962 Update 1: Unable to access interface: No such device #169

Open EasyBakerFox opened 1 year ago

EasyBakerFox commented 1 year ago

Description The intended use case is a VPN client outside of a home network, which is behind a Fritzbox 6490, that connects to a server running WireGuard.

I am configuring Wireguard (WeeJewel WG-easy for Docker image) for the first time. Receives two errors: RTNETLINK answers: Address already in use, Unable to access interface: No such device. This is the only service using this port 51820.

I included pictures of the DSM and it appears that the ports are not set for WG in Services.

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.0.1.1/16 dev wg0
[#] ip link set mtu 1420 up dev wg0
RTNETLINK answers: Address already in use
[#] ip link delete dev wg0
root@Server1:~# sudo wg show wg0
Unable to access interface: No such device

Expected behavior complete set up.

Synology NAS model DS716+2

wg0.conf

root@Server1:~# sudo cat /etc/wireguard/wg0.conf
[Interface]
Address = 10.0.1.1/16
PrivateKey = [private key]
ListenPort = 51820
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 = [public key]
AllowedIPs = 10.0.1.2/32

Service Router Configuration wg-easy running

Nightreaver commented 1 year ago

As you can see from ip -4 address add 10.0.1.1/16 dev wg0 and RTNETLINK answers: Address already in use it seems to be an IP conflict, thus your interface doesn't come up. check ip addresses used on your nas and/or change the IP used by wireguard.

I'm personally using 10.13.13.1