In the following Scenario, I have set up a machine (a), located behind a simple NAT with no further configuration, establishing a Wireguard tunnel (wg0) to another machine (b), connected with a static IP and no NAT to the internet. (All machines running on Debian 10)
Machine (a) exposes a SSH and an HTTP service via Wireguard to machine (b).
When I'm locally on machine (a) all works perfectly, the machine reacts instantly to any SSH command and HTTP request.
The tunnel (wg0) also seems to work fine, handshaking works, machine (a) can ping machine (b) and other way round, machine (b) can SSH to the exposed service on machine (b) ; but, for example, when I use VIM via Wireguard (wg0) on machine (a) it actually takes minutes to load the tui, while nano loads instantly. When I tail logs, and the output is massive, it can take from seconds to minutes to display. Finally, HTTP requests from machine (b) via Wireguard (wg0) to machine (a) it takes about 30s until the request succeeds.
Machine (a)'s wg0 IP: 10.200.1.7
Machine (a)'s HTTP Port: 9500
Machine (b)'s wg0 IP: 10.200.1.1
Here is a sample HTTP request's tcpdump on machine (a)'s wg0 interface which needed about 35s to succeed:
01:05:53.261678 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [S], seq 592157087, win 27600, options [mss 1380,sackOK,TS val 4192760482 ecr 0,nop,wscale 7], length 0
01:05:53.261809 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [S.], seq 1181067477, ack 592157088, win 28960, options [mss 1460,sackOK,TS val 1595828258 ecr 4192760482,nop,wscale 7], length 0
01:05:53.284094 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [.], ack 1, win 216, options [nop,nop,TS val 4192760502 ecr 1595828258], length 0
01:05:53.284163 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [P.], seq 1:80, ack 1, win 216, options [nop,nop,TS val 4192760502 ecr 1595828258], length 79
01:05:53.284295 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], ack 80, win 227, options [nop,nop,TS val 1595828280 ecr 4192760502], length 0
01:05:53.312174 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:2737, ack 80, win 227, options [nop,nop,TS val 1595828308 ecr 4192760502], length 2736
01:05:53.312195 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [P.], seq 2737:4240, ack 80, win 227, options [nop,nop,TS val 1595828308 ecr 4192760502], length 1503
01:05:53.312241 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [P.], seq 4240:5310, ack 80, win 227, options [nop,nop,TS val 1595828308 ecr 4192760502], length 1070
01:05:53.312284 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [P.], seq 5310:5315, ack 80, win 227, options [nop,nop,TS val 1595828308 ecr 4192760502], length 5
01:05:53.335447 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [.], ack 1, win 224, options [nop,nop,TS val 4192760554 ecr 1595828280,nop,nop,sack 1 {4105:4240}], length 0
01:05:53.335498 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [.], ack 1, win 241, options [nop,nop,TS val 4192760554 ecr 1595828280,nop,nop,sack 1 {4105:5310}], length 0
01:05:53.335507 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [.], ack 1, win 241, options [nop,nop,TS val 4192760554 ecr 1595828280,nop,nop,sack 1 {4105:5315}], length 0
01:05:53.335548 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595828331 ecr 4192760554], length 1368
01:05:53.567095 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595828563 ecr 4192760554], length 1368
01:05:54.043110 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595829039 ecr 4192760554], length 1368
01:05:54.971106 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595829967 ecr 4192760554], length 1368
01:05:56.794963 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595831791 ecr 4192760554], length 1368
01:05:58.299595 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [F.], seq 5315, ack 80, win 227, options [nop,nop,TS val 1595833295 ecr 4192760554], length 0
01:05:58.320249 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [.], ack 1, win 241, options [nop,nop,TS val 4192765540 ecr 1595828280,nop,nop,sack 1 {4105:5316}], length 0
01:05:58.320392 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595833316 ecr 4192765540], length 1368
01:05:58.547111 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595833543 ecr 4192765540], length 1368
01:05:59.003093 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595833999 ecr 4192765540], length 1368
01:05:59.931111 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595834927 ecr 4192765540], length 1368
01:06:01.755118 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595836751 ecr 4192765540], length 1368
01:06:05.595114 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595840591 ecr 4192765540], length 1368
01:06:13.019153 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595848015 ecr 4192765540], length 1368
01:06:27.611117 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1:1369, ack 80, win 227, options [nop,nop,TS val 1595862607 ecr 4192765540], length 1368
01:06:27.634605 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [.], ack 1369, win 263, options [nop,nop,TS val 4192794853 ecr 1595862607,nop,nop,sack 1 {4105:5316}], length 0
01:06:27.634721 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 1369:2737, ack 80, win 227, options [nop,nop,TS val 1595862630 ecr 4192794853], length 1368
01:06:27.634755 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], seq 2737:4105, ack 80, win 227, options [nop,nop,TS val 1595862630 ecr 4192794853], length 1368
01:06:27.656603 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [.], ack 2737, win 284, options [nop,nop,TS val 4192794876 ecr 1595862630,nop,nop,sack 1 {4105:5316}], length 0
01:06:27.656683 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [.], ack 5316, win 305, options [nop,nop,TS val 4192794877 ecr 1595862630], length 0
01:06:27.658916 IP 10.200.1.1.58062 > 10.200.1.7.9500: Flags [F.], seq 80, ack 5316, win 305, options [nop,nop,TS val 4192794877 ecr 1595862630], length 0
01:06:27.659043 IP 10.200.1.7.9500 > 10.200.1.1.58062: Flags [.], ack 81, win 227, options [nop,nop,TS val 1595862655 ecr 4192794877], length 0
I also tested from a machine (c) via another tunnel (wg1) with same behaviour on machine (a)...
Do you have any idea what could be causing these problems? Thank you a lot for any advice!