runfalk / synology-wireguard

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

DSM 7 second WireGuard interface does not start #106

Open lmatusek opened 2 years ago

lmatusek commented 2 years ago

After wg0 interface starts successfully:

lmatusek@Station18:~$ sudo wg-quick up wg0
[#] ip link add wg0 type wireguard
[#] wg setconf wg0 /dev/fd/63
[#] ip -4 address add 172.16.28.252/24 dev wg0
[#] ip link set mtu 1420 up dev wg0

wg1 doesn't:

lmatusek@Station18:~$ sudo wg-quick up wg1
[#] ip link add wg1 type wireguard
[#] wg setconf wg1 /dev/fd/63
[#] ip -4 address add 10.1.1.254/32 dev wg1
[#] ip link set mtu 1420 up dev wg1
RTNETLINK answers: Address already in use
[#] ip link delete dev wg1

wg1.conf is the following:

[Interface]
PrivateKey = YKl/8CkT9RS4M7MfeUy+O7IN3R4UF7CFHM22OKvhP00=
# PublicKey = XVPyWhptVjwfEVOWyfOR8cvK1C+KM+kKk1y8QMdufDk=

Address = 10.1.1.254/32
ListenPort = 1199

[Peer]
PublicKey = 6OUX5rYRpQHeIA8zkd9H5gN1cEparaKdIgdDYTcWVR8=
# PrivateKey = EFGJAmRzpVyrfWbxWm/M6P5IifTZYWz2aCCjwwA47m4=
AllowedIPs = 10.1.1.1/32

This story was working on DSM 6.2 smoothly. What's wrong? Could you be so kind to help me?

Thanks in advance.

ben-ba commented 2 years ago

Show us your wg0 config and an output of sudo ip add and sudo netstat -tupeena | grep 1199

lmatusek commented 2 years ago

At the end you opened my eyes, I was using same listening port for both interface. So, that was my serious mistake. I am so sorry….

Thanks for your effort and time…

Here they are:

[Interface] PrivateKey = 0PX**** Address = 172.16.28.252/24 ListenPort = 1199

PostUp = sleep 5; ip route add 172.16.28.0/24 dev %i

; iptables -t nat -A POSTROUTING -o bond0 -j MASQUERADE

iptables -A FORWARD -i %i -j ACCEPT; sleep 5; ip route add 172.16.28.0/24 dev %i; iptables -t nat -A POSTROUTING -o bond0 -j MASQUERADE

PreDown = sleep 5; ip route del 172.16.28.0/24 dev %i

; iptables -t nat -D POSTROUTING -o bond0 -j MASQUERADE

DNS = 1.1.1.1, 1.0.0.1, 2606:4700:4700::1111

wg genkey | tee privatekey | wg pubkey > publickey

[Peer]

iMac2020

PublicKey = GvLY*** AllowedIPs = 172.16.28.2/32

[Peer]

iPad Laci

PublicKey = re1JHj8p*** AllowedIPs = 172.16.28.3/32

[Peer]

MacBookPro Laci

PublicKey = *** AllowedIPs = 172.16.28.4/32

[Peer]

Anyu

PublicKey = *** AllowedIPs = 172.16.28.5/32

[Peer]

Mikrotik_Prudent

PublicKey = *** AllowedIPs = 172.16.28.6/32

————

@.***:~$ sudo wg-quick up wg0 [#] ip link add wg0 type wireguard [#] wg setconf wg0 /dev/fd/63 [#] ip -4 address add 172.16.28.252/24 dev wg0 [#] ip link set mtu 1420 up dev wg0

@.:~$ sudo wg-quick up wg1 [#] ip link add wg1 type wireguard [#] wg setconf wg1 /dev/fd/63 [#] ip -4 address add 10.1.1.254/32 dev wg1 [#] ip link set mtu 1420 up dev wg1 RTNETLINK answers: Address already in use [#] ip link delete dev wg1 ——— @.:~$ sudo netstat -tupeena | grep 1199 udp 0 0 0.0.0.0:1199 0.0.0.0: 0 287069921 - udp6 0 0 :::1199 ::: 0 287069922 - ————

  1. szept. 26. dátummal, 15:45 időpontban ben-ba @.***> írta:

Show us your wg0 config and an output of sudo ip add and sudo netstat -tupeena | grep 1199

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/runfalk/synology-wireguard/issues/106#issuecomment-927309195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGP4O65LLYO4IXEAWZHHTTUD4PWBANCNFSM5EPT73HQ. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.