runfalk / synology-wireguard

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

Speed decrease #95

Open Casburggraaf opened 2 years ago

Casburggraaf commented 2 years ago

Description I don't know what happend but my vpn speed is capped around 70mbit. Beforehand ik could get at least 300mbit. I have a 600/600 mbit connection on the nas and get this speeds with speedtest-cli(on the nas)

Steps to reproduce connection to nas. Tried on both my Mac and iOS devices. Download a file trough dsm file manager gets me download speed of 300 mbit. So no problem with the connection of the client and the server. Cpu is only 20% when using WireGuard..

Expected behavior As before, faster vpn speeds

Synology NAS model DS1820+ Latest release of wire-guard

wg0.conf Server

[Interface]
SaveConfig = true
PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE ; sleep 5 ; ip route add 10.0.0.0/16 dev %i
PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
ListenPort = 51820
PrivateKey = KEY

[Peer]
PublicKey = KEY
AllowedIPs = 10.0.1.2/32
Endpoint = IP:51820

wg0.conf Client

[Interface]
PrivateKey = KEY
ListenPort = 51820
Address = 10.0.1.4/32
DNS = 1.1.1.1

[Peer]
PublicKey = KEY
AllowedIPs = 0.0.0.0/0
Endpoint = IP:51820
newkind commented 2 years ago

I can confirm the same issue. Normal speeds are around 70mbps, but manipulating clients MTU allowed me to go as much as up to 100mbps. Even when testing local network speeds while using iperf I cannot get anywhere above 100mbps range which is just not good. It's enough, but there's an issue somewhere for sure.

ben-ba commented 2 years ago

@newkind to find the optimal mtu, maybe this script would be helpful.

https://www.reddit.com/r/WireGuard/comments/po1w4m/optimal_wg_server_peer_mtu_finder_part_2/