Linux WireGuard VPN 入坑指南 4 问题与调试
例行检查
- 在服务端观测 客户端的报文 传输状态
如果都没有报文传输过来, 需要先把网络连通性的问题解决!
1 |
|
- 查看 心跳/密钥交换
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22sudo modprobe wireguard
echo module wireguard +p > /sys/kernel/debug/dynamic_debug/control # 开启调试
echo module wireguard -p > /sys/kernel/debug/dynamic_debug/control # 关闭调试
dmesg -wT
输出结果
[Thu Jul 1 14:40:45 2021] wireguard: VPN: Receiving keepalive packet from peer 138 (180.169.232.173:2115)
[Thu Jul 1 14:40:45 2021] wireguard: VPN: Receiving keepalive packet from peer 137 (183.193.39.167:4028)
[Thu Jul 1 14:40:45 2021] wireguard: VPN: Receiving handshake initiation from peer 137 (183.193.39.167:4028)
[Thu Jul 1 14:40:45 2021] wireguard: VPN: Sending handshake response to peer 137 (183.193.39.167:4028)
[Thu Jul 1 14:40:45 2021] wireguard: VPN: Keypair 1017269 destroyed for peer 137
[Thu Jul 1 14:40:45 2021] wireguard: VPN: Keypair 1017275 created for peer 137
[Thu Jul 1 14:40:45 2021] wireguard: VPN: Receiving keepalive packet from peer 137 (183.193.39.167:4028)
[Thu Jul 1 14:40:47 2021] wireguard: VPN: Receiving keepalive packet from peer 138 (180.169.232.173:2115)
[Thu Jul 1 14:40:49 2021] wireguard: VPN: Receiving keepalive packet from peer 138 (180.169.232.173:2115)
[Thu Jul 1 14:40:51 2021] wireguard: VPN: Receiving keepalive packet from peer 138 (180.169.232.173:2115)
[Thu Jul 1 14:40:53 2021] wireguard: VPN: Receiving keepalive packet from peer 138 (180.169.232.173:2115)
[Thu Jul 1 14:40:56 2021] wireguard: VPN: Receiving keepalive packet from peer 138 (180.169.232.173:2115)
[Thu Jul 1 14:40:56 2021] wireguard: VPN: Sending keepalive packet to peer 136 (183.193.39.167:3112)
[Thu Jul 1 14:40:58 2021] wireguard: VPN: Receiving keepalive packet from peer 138 (180.169.232.173:2115)
[Thu Jul 1 14:41:00 2021] wireguard: VPN: Receiving keepalive packet from peer 138 (180.169.232.173:2115)
问题
问题1
NAT 内的 ubuntu_wireguard 无法与阿里云的VPS握手成功
1 |
|
2022.06.24 更新
解决NAT超时问题
服务器端的每个 PEER 也要设置 PersistentKeepalive = 25