我有两个通过 VPN 连接 (Wireguard) 连接的网络。让我们称呼他们为站点A和站点B。
VPN 连接正常,路由已设置,站点 A 和站点 B 的所有计算机都可以相互 ping 通,没有任何问题。访问网页站点B从站点A直到最近才恢复正常(有时会工作,然后突然再次停止),访问站点 B 上的任何网页都会出现一个永远加载的白色网页,永远不会结束加载。
当需要传输更大的数据块(例如网页图像或更大的 HTML 文件 (1KB+))时,问题就会出现,响应永远不会完全到达。
确实会加载非常小的页面。在每种情况下,服务器都会看到发出了请求,但客户端没有收到任何答复。
运行 IPERF3 可以更详细地显示该问题:
站点A:
root@aligator:~# iperf3 -c 192.168.178.254 -R
Connecting to host 192.168.178.254, port 5201
Reverse mode, remote host 192.168.178.254 is sending
[ 4] local 192.168.250.254 port 53480 connected to 192.168.178.254 port 5201
[ ID] Interval Transfer Bandwidth
[ 4] 0.00-1.00 sec 1.03 MBytes 8.64 Mbits/sec
[ 4] 1.00-2.00 sec 1.17 MBytes 9.80 Mbits/sec
[ 4] 2.00-3.00 sec 870 KBytes 7.12 Mbits/sec
[ 4] 3.00-4.00 sec 477 KBytes 3.91 Mbits/sec
[ 4] 4.00-5.00 sec 325 KBytes 2.66 Mbits/sec
[ 4] 5.00-6.00 sec 407 KBytes 3.34 Mbits/sec
[ 4] 6.00-7.00 sec 454 KBytes 3.72 Mbits/sec
[ 4] 7.00-8.00 sec 556 KBytes 4.55 Mbits/sec
[ 4] 8.00-9.00 sec 633 KBytes 5.19 Mbits/sec
[ 4] 9.00-10.00 sec 442 KBytes 3.62 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 7.03 MBytes 5.90 Mbits/sec 25 sender
[ 4] 0.00-10.00 sec 6.39 MBytes 5.36 Mbits/sec receiver
iperf Done.
root@aligator:~# iperf3 -c 192.168.178.254
Connecting to host 192.168.178.254, port 5201
[ 4] local 192.168.250.254 port 53484 connected to 192.168.178.254 port 5201
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 4] 0.00-1.00 sec 88.2 KBytes 721 Kbits/sec 1 1.34 KBytes
[ 4] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 1 1.34 KBytes
[ 4] 2.00-3.00 sec 0.00 Bytes 0.00 bits/sec 1 1.34 KBytes
[ 4] 3.00-4.00 sec 0.00 Bytes 0.00 bits/sec 0 1.34 KBytes
[ 4] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 1 1.34 KBytes
[ 4] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 0 1.34 KBytes
[ 4] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 0 1.34 KBytes
[ 4] 7.00-8.00 sec 0.00 Bytes 0.00 bits/sec 0 1.34 KBytes
[ 4] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec 0 1.34 KBytes
[ 4] 9.00-10.00 sec 0.00 Bytes 0.00 bits/sec 1 1.34 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 4] 0.00-10.00 sec 88.2 KBytes 72.2 Kbits/sec 5 sender
[ 4] 0.00-10.00 sec 0.00 Bytes 0.00 bits/sec receiver
iperf Done.
站点B:
root@baloon:~# iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.250.254, port 53506
[ 5] local 192.168.178.254 port 5201 connected to 192.168.250.254 port 53508
[ ID] Interval Transfer Bandwidth Retr Cwnd
[ 5] 0.00-1.00 sec 688 KBytes 5.63 Mbits/sec 3 58.8 KBytes
[ 5] 1.00-2.00 sec 541 KBytes 4.43 Mbits/sec 3 33.4 KBytes
[ 5] 2.00-3.00 sec 502 KBytes 4.12 Mbits/sec 0 41.4 KBytes
[ 5] 3.00-4.00 sec 251 KBytes 2.06 Mbits/sec 2 37.4 KBytes
[ 5] 4.00-5.00 sec 502 KBytes 4.12 Mbits/sec 0 41.4 KBytes
[ 5] 5.00-6.00 sec 377 KBytes 3.09 Mbits/sec 0 48.1 KBytes
[ 5] 6.00-7.00 sec 502 KBytes 4.12 Mbits/sec 1 41.4 KBytes
[ 5] 7.00-8.00 sec 377 KBytes 3.09 Mbits/sec 1 36.1 KBytes
[ 5] 8.00-9.00 sec 502 KBytes 4.12 Mbits/sec 1 28.1 KBytes
[ 5] 9.00-10.00 sec 251 KBytes 2.06 Mbits/sec 0 34.7 KBytes
[ 5] 10.00-10.09 sec 126 KBytes 11.4 Mbits/sec 0 34.7 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth Retr
[ 5] 0.00-10.09 sec 4.51 MBytes 3.75 Mbits/sec 11 sender
[ 5] 0.00-10.09 sec 0.00 Bytes 0.00 bits/sec receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.250.254, port 53510
[ 5] local 192.168.178.254 port 5201 connected to 192.168.250.254 port 53512
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-1.00 sec 0.00 Bytes 0.00 bits/sec
[ 5] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec
[ 5] 2.00-3.00 sec 0.00 Bytes 0.00 bits/sec
[ 5] 3.00-4.00 sec 0.00 Bytes 0.00 bits/sec
[ 5] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec
[ 5] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec
[ 5] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec
[ 5] 7.00-8.00 sec 0.00 Bytes 0.00 bits/sec
[ 5] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec
[ 5] 9.00-10.00 sec 0.00 Bytes 0.00 bits/sec
[ 5] 10.00-10.09 sec 0.00 Bytes 0.00 bits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bandwidth
[ 5] 0.00-10.09 sec 0.00 Bytes 0.00 bits/sec sender
[ 5] 0.00-10.09 sec 0.00 Bytes 0.00 bits/sec receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
因此,在两次测试运行中,服务器和客户端都看到有一个新请求,但没有数据从站点 B 发送到站点 A(至少不超过一些字节)。
另外,这个问题似乎会随机消失并再次出现,因此有时双向通信会正常工作一段时间,然后再次崩溃。但 Pinging 总是有效(SSH 通常也是如此)。
我知道这可能不足以解决问题,但我不知道从哪里开始搜索问题(路由、VPN、不可靠网络?)。有人能指出什么样的问题会产生这种行为吗?从哪里开始寻找原因最好?