======================================= FreeBSD Copy files from remote servers SLOW over OpenVPN and Wireguard --------------------------------------- Here are some black magic settings to fix this problem. It may be specific to VirtualBox virtio network interfaces. Connecting via OpenVPN or Wireguard servers to copy files FROM remote LAN servers was slow. ======================================= How slow you ask? --------------------------------------- oeng@guido:~ $ time scp foo 192.168.123.109:/home/oeng/foo Enter passphrase for key '/home/oeng/.ssh/id_rsa': foo 100% 649KB 2.4MB/s 00:00 4.62 real 0.25 user 0.00 sys oeng@guido:~ $ time scp 192.168.123.109:/home/oeng/foo foo Enter passphrase for key '/home/oeng/.ssh/id_rsa': foo 100% 649KB 3.8KB/s 02:50 174.66 real 0.26 user 0.00 sys --------------------------------------- oeng@guido:~ $ time scp foo5 192.168.123.109:/home/oeng/foo5 Enter passphrase for key '/home/oeng/.ssh/id_rsa': foo 100% 507MB 5.0MB/s 01:42 106.47 real 1.88 user 1.49 sys oeng@guido:~ $ time scp 192.168.123.109:/home/oeng/foo5 foo5 Enter passphrase for key '/home/oeng/.ssh/id_rsa': foo 0% 40KB 1.2KB/s 124:24:04 E^C <--- fuck that 23.60 real 0.24 user 0.00 sys ======================================= The FIX --------------------------------------- The remote vpn servers were set up to listen on the public interface (vtnet1). The lan interface was (vtnet0). After connecting to the vpn server the tunnel (tun0 or wg0) was established for full LAN access. Everything worked except copying files from any remote lan server was painfully slow. After adding these settings and rebooting... upload and download speeds were excellent. ======================================= /boot/loader.conf --------------------------------------- hw.vtnet.tso_disable="1" hw.vtnet.0.tso_disable="1" hw.vtnet.lro_disable="1" hw.vtnet.0.lro_disable="1" hw.vtnet.csum_disable="1" hw.vtnet.0.csum_disable="1" ======================================= black magic? =======================================