两台新安装系统的 VPS,一模一样的安装 WG 的方法,怎么一台正常一台无法用呢?

207 天前
 s4d
系统情况:
系统是 ubuntu 22 ,新安装的系统。Docker 安装 wg-easy.

有问题的那一台尝试重装了很多次,两台 VPS 的网络不通,一台是美西 GIA ,一台是 HK GIA
HK GIA 的有问题,怀疑是 MTU 的问题,多次尝试修改无效。

尝试过修改端口,无效。

服务器没有开 ufw ,ip route get 路由正确。



安装脚本:
version: "3.3"
services:
wg-easy:
container_name: wg-easy
environment:
- WG_HOST=xxx.xxx.one
- PASSWORD=pwdtest
- WG_MTU=1420
- WG_PERSISTENT_KEEPALIVE=25
- WG_DEFAULT_ADDRESS=192.168.18.x
- WG_DEFAULT_DNS=8.8.8.8,1.1.1.1
- WG_ALLOWED_IPS=0.0.0.0/0,::/0
volumes:
- /root/docker_data/wg-easy:/etc/wireguard
ports:
- 41820:51820/udp
- 41821:51821/tcp
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
- net.ipv4.ip_forward=1
restart: always
image: ghcr.io/wg-easy/wg-easy
networks: {}

日志:

2024-04-28 09:10:03.139 [APP] startActivation: Entering (tunnel: DMIT-299-1_TMBP)
2024-04-28 09:10:03.141 [APP] startActivation: Starting tunnel
2024-04-28 09:10:03.141 [APP] startActivation: Success
2024-04-28 09:10:03.147 [APP] Tunnel 'DMIT-299-1_TMBP' connection status changed to 'connecting'
2024-04-28 09:10:03.272 [NET] App version: 1.0.16 (27)
2024-04-28 09:10:03.272 [NET] Starting tunnel from the app
2024-04-28 09:10:03.891 [NET] DNS64: mapped 103.135.x.x (服务器 IP) to itself.
2024-04-28 09:10:03.891 [NET] Attaching to interface
2024-04-28 09:10:03.892 [NET] UAPI: Updating private key
2024-04-28 09:10:03.892 [NET] Routine: handshake worker 4 - started
2024-04-28 09:10:03.892 [NET] Routine: decryption worker 2 - started
2024-04-28 09:10:03.892 [NET] UAPI: Removing all peers
2024-04-28 09:10:03.892 [NET] Routine: handshake worker 2 - started
2024-04-28 09:10:03.892 [NET] Routine: decryption worker 1 - started
2024-04-28 09:10:03.892 [NET] Routine: encryption worker 1 - started
2024-04-28 09:10:03.892 [NET] Routine: encryption worker 3 - started
2024-04-28 09:10:03.892 [NET] Routine: encryption worker 2 - started
2024-04-28 09:10:03.892 [NET] Routine: event worker - started
2024-04-28 09:10:03.892 [NET] Routine: encryption worker 7 - started
2024-04-28 09:10:03.892 [NET] Routine: encryption worker 5 - started
2024-04-28 09:10:03.892 [NET] Routine: decryption worker 4 - started
2024-04-28 09:10:03.892 [NET] Routine: handshake worker 1 - started
2024-04-28 09:10:03.892 [NET] Routine: handshake worker 3 - started
2024-04-28 09:10:03.892 [NET] Routine: encryption worker 4 - started
2024-04-28 09:10:03.892 [NET] Routine: encryption worker 6 - started
2024-04-28 09:10:03.892 [NET] Routine: decryption worker 3 - started
2024-04-28 09:10:03.892 [NET] Routine: decryption worker 7 - started
2024-04-28 09:10:03.892 [NET] Routine: handshake worker 7 - started
2024-04-28 09:10:03.892 [NET] Routine: decryption worker 6 - started
2024-04-28 09:10:03.892 [NET] Routine: handshake worker 6 - started
2024-04-28 09:10:03.892 [NET] Routine: decryption worker 8 - started
2024-04-28 09:10:03.892 [NET] Routine: handshake worker 8 - started
2024-04-28 09:10:03.892 [NET] Routine: decryption worker 5 - started
2024-04-28 09:10:03.892 [NET] Routine: handshake worker 5 - started
2024-04-28 09:10:03.892 [NET] Routine: encryption worker 8 - started
2024-04-28 09:10:03.892 [NET] Routine: TUN reader - started
2024-04-28 09:10:03.893 [NET] peer(aUHP…zrhw) - UAPI: Created
2024-04-28 09:10:03.893 [NET] peer(aUHP…zrhw) - UAPI: Updating preshared key
2024-04-28 09:10:03.893 [NET] peer(aUHP…zrhw) - UAPI: Updating endpoint
2024-04-28 09:10:03.893 [NET] peer(aUHP…zrhw) - UAPI: Updating persistent keepalive interval
2024-04-28 09:10:03.893 [NET] peer(aUHP…zrhw) - UAPI: Removing all allowedips
2024-04-28 09:10:03.894 [NET] peer(aUHP…zrhw) - UAPI: Adding allowedip
2024-04-28 09:10:03.894 [NET] peer(aUHP…zrhw) - UAPI: Adding allowedip
2024-04-28 09:10:03.894 [NET] UDP bind has been updated
2024-04-28 09:10:03.894 [NET] Routine: receive incoming v4 - started
2024-04-28 09:10:03.894 [NET] peer(aUHP…zrhw) - Starting
2024-04-28 09:10:03.894 [NET] Routine: receive incoming v6 - started
2024-04-28 09:10:03.894 [NET] peer(aUHP…zrhw) - Routine: sequential sender - started
2024-04-28 09:10:03.894 [NET] peer(aUHP…zrhw) - Sending keepalive packet
2024-04-28 09:10:03.894 [NET] peer(aUHP…zrhw) - Routine: sequential receiver - started
2024-04-28 09:10:03.894 [NET] peer(aUHP…zrhw) - Sending handshake initiation
2024-04-28 09:10:03.895 [NET] Interface state was Down, requested Up, now Up
2024-04-28 09:10:03.895 [NET] Device started
2024-04-28 09:10:03.895 [NET] Tunnel interface is utun3
2024-04-28 09:10:03.895 [NET] Network change detected with satisfied route and interface order [en0]
2024-04-28 09:10:03.895 [NET] Routine: receive incoming v4 - stopped
2024-04-28 09:10:03.896 [NET] Routine: receive incoming v6 - stopped
2024-04-28 09:10:03.896 [NET] UDP bind has been updated
2024-04-28 09:10:03.896 [NET] Routine: receive incoming v6 - started
2024-04-28 09:10:03.896 [NET] Routine: receive incoming v4 - started
2024-04-28 09:10:03.896 [APP] Tunnel 'DMIT-299-1_TMBP' connection status changed to 'connected'
2024-04-28 09:10:03.937 [NET] peer(aUHP…zrhw) - Received handshake response
2024-04-28 09:10:03.997 [NET] Network change detected with satisfied route and interface order [en0, utun3]
2024-04-28 09:10:03.998 [NET] Routine: receive incoming v4 - stopped
2024-04-28 09:10:03.999 [NET] Routine: receive incoming v6 - stopped
2024-04-28 09:10:03.999 [NET] UDP bind has been updated
2024-04-28 09:10:03.999 [NET] peer(aUHP…zrhw) - Sending keepalive packet
2024-04-28 09:10:04.000 [NET] Routine: receive incoming v4 - started
2024-04-28 09:10:04.000 [NET] Routine: receive incoming v6 - started
2024-04-28 09:10:08.142 [APP] Status update notification timeout for tunnel 'DMIT-299-1_TMBP'. Tunnel status is now 'connected'.
2024-04-28 09:10:19.918 [NET] peer(aUHP…zrhw) - Received handshake initiation ——— 问题出现 ———
2024-04-28 09:10:19.918 [NET] peer(aUHP…zrhw) - Sending handshake response
2024-04-28 09:10:25.008 [NET] peer(aUHP…zrhw) - Received handshake initiation
2024-04-28 09:10:25.008 [NET] peer(aUHP…zrhw) - Sending handshake response
2024-04-28 09:10:30.382 [NET] peer(aUHP…zrhw) - Received handshake initiation
2024-04-28 09:10:30.382 [NET] peer(aUHP…zrhw) - Sending handshake response
2024-04-28 09:10:35.523 [NET] peer(aUHP…zrhw) - Received handshake initiation
2024-04-28 09:10:35.523 [NET] peer(aUHP…zrhw) - Sending handshake response
2024-04-28 09:10:40.643 [NET] peer(aUHP…zrhw) - Received handshake initiation
2024-04-28 09:10:40.643 [NET] peer(aUHP…zrhw) - Sending handshake response
2024-04-28 09:10:44.460 [APP] startDeactivation: Tunnel: DMIT-299-1_TMBP —— 手动停止 WG ————
2024-04-28 09:10:44.467 [APP] Tunnel 'DMIT-299-1_TMBP' connection status changed to 'disconnecting'
2024-04-28 09:10:44.611 [NET] Network change detected with satisfied route and interface order [en0]
2024-04-28 09:10:44.613 [NET] Routine: receive incoming v4 - stopped
2024-04-28 09:10:44.613 [NET] Routine: receive incoming v6 - stopped
2024-04-28 09:10:44.613 [NET] UDP bind has been updated
2024-04-28 09:10:44.618 [NET] Routine: receive incoming v4 - started
2024-04-28 09:10:44.618 [NET] peer(aUHP…zrhw) - Sending keepalive packet
2024-04-28 09:10:44.620 [NET] Routine: receive incoming v6 - started
2024-04-28 09:10:44.846 [NET] Stopping tunnel
2024-04-28 09:10:44.846 [NET] Device closing
2024-04-28 09:10:44.846 [NET] Routine: TUN reader - stopped
2024-04-28 09:10:44.846 [NET] Routine: event worker - stopped
2024-04-28 09:10:44.846 [NET] Routine: receive incoming v4 - stopped
2024-04-28 09:10:44.846 [NET] Routine: receive incoming v6 - stopped
2024-04-28 09:10:44.846 [NET] peer(aUHP…zrhw) - Stopping
2024-04-28 09:10:44.846 [NET] peer(aUHP…zrhw) - Routine: sequential sender - stopped
2024-04-28 09:10:44.846 [NET] peer(aUHP…zrhw) - Routine: sequential receiver - stopped
2024-04-28 09:10:44.847 [NET] Device closed
2024-04-28 09:10:44.847 [NET] Routine: decryption worker 7 - stopped
2024-04-28 09:10:44.847 [NET] Routine: decryption worker 4 - stopped
2024-04-28 09:10:44.847 [NET] Routine: decryption worker 8 - stopped
2024-04-28 09:10:44.847 [NET] Routine: decryption worker 2 - stopped
2024-04-28 09:10:44.847 [NET] Routine: decryption worker 3 - stopped
2024-04-28 09:10:44.847 [NET] Routine: handshake worker 8 - stopped
2024-04-28 09:10:44.847 [NET] Routine: decryption worker 1 - stopped
2024-04-28 09:10:44.847 [NET] Routine: handshake worker 3 - stopped
2024-04-28 09:10:44.847 [NET] Routine: handshake worker 4 - stopped
2024-04-28 09:10:44.847 [NET] Routine: decryption worker 6 - stopped
2024-04-28 09:10:44.847 [NET] Routine: handshake worker 5 - stopped
2024-04-28 09:10:44.847 [NET] Routine: handshake worker 6 - stopped
2024-04-28 09:10:44.847 [NET] Routine: handshake worker 1 - stopped
2024-04-28 09:10:44.847 [NET] Routine: handshake worker 2 - stopped
2024-04-28 09:10:44.847 [NET] Routine: decryption worker 5 - stopped
2024-04-28 09:10:44.847 [NET] Routine: handshake worker 7 - stopped
2024-04-28 09:10:44.847 [NET] Routine: encryption worker 6 - stopped
2024-04-28 09:10:44.847 [NET] Routine: encryption worker 8 - stopped
2024-04-28 09:10:44.847 [NET] Routine: encryption worker 1 - stopped
2024-04-28 09:10:44.847 [NET] Routine: encryption worker 7 - stopped
2024-04-28 09:10:44.847 [NET] Routine: encryption worker 4 - stopped
2024-04-28 09:10:44.847 [NET] Routine: encryption worker 3 - stopped
2024-04-28 09:10:44.847 [NET] Routine: encryption worker 5 - stopped
2024-04-28 09:10:44.847 [NET] Routine: encryption worker 2 - stopped
2024-04-28 09:10:44.853 [APP] Tunnel 'DMIT-299-1_TMBP' connection status changed to 'disconnected'
844 次点击
所在节点    VPS
5 条回复
canyue7897
207 天前
香港的 udp 一直有问题。我用的就是这样的,当然我用不起 hk gia,我用的 udp 都或多或少有问题。
northbrunv
207 天前
hk 怕挨揍很多商家一刀切直接禁止 udp
s4d
206 天前
@northbrunv
@canyue7897 DMIT HK GIA 禁 udp 了吗?之前买了他们家 JP GIA 没禁
canyue7897
204 天前
商家没有禁止 udp ,但是你的运营商会 qos,我都遇到广州电信好几次了。正在用着,udp 速度突然断崖式下降。以前没有,怀疑割裂接的问题。
s4d
204 天前
@canyue7897 香港的有这个问题。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1036261

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX