Wireguard(客户端)在启用 Windows IP 转发的情况下无法运行

Wireguard(客户端)在启用 Windows IP 转发的情况下无法运行

我在 Windows 上使用 WireGuard 客户端时遇到问题。当我尝试连接到 WireGuard 服务器时,没有 ping,没有域名解析 - 什么都没有。WireGuard 显示我确实以每秒 1GB 的速度发送了数据包。此外,我的 PC 开始冻结,即使 CPU/HDD/RAM 等没有负载。Android 甚至在 Windows 内运行的 Linux VM 都运行良好。

如果我在 regedit 中将 IPEnableRouter 设置为 0,则一切正常。如果我使用“netsh interface ipv4 set interface *** forwarding=disabled”禁用接口转发,则一切正常。但是,我正在寻找另一种解决方案,因为这个解决方案是不可接受的,因为它禁用了接口之间的路由。

2022-03-19 18:59:47.241: [TUN] [PC] Monitoring MTU of default v6 routes 
2022-03-19 18:59:47.241: [TUN] [PC] Setting device v6 addresses 
2022-03-19 18:59:47.244: [TUN] [PC] Warning: the "Ethernet" interface has Forwarding/WeakHostSend enabled, which will cause routing loops 
2022-03-19 18:59:47.339: [TUN] [PC] Startup complete 
2022-03-19 19:00:02.211: [TUN] [PC] Retrying handshake with peer 1 (3.***.***.93:1**2) because we stopped hearing back after 15 seconds 
2022-03-19 19:00:02.211: [TUN] [PC] Sending handshake initiation to peer 1 (3.***.***.93:1**2) 
2022-03-19 19:00:07.357: [TUN] [PC] Handshake for peer 1 (3.***.***.93:1**2) did not complete after 5 seconds, retrying (try 2) 
2022-03-19 19:00:07.357: [TUN] [PC] Sending handshake initiation to peer 1 (3.***.***.93:1**2) 
2022-03-19 19:00:12.415: [TUN] [PC] Handshake for peer 1 (3.***.***.93:1**2) did not complete after 5 seconds, retrying (try 3) 
2022-03-19 19:00:12.415: [TUN] [PC] Sending handshake initiation to peer 1 (3.***.***.93:1**2) 
2022-03-19 19:00:17.531: [TUN] [PC] Handshake for peer 1 (3.***.***.93:1**2) did not complete after 5 seconds, retrying (try 4) 
2022-03-19 19:00:17.531: [TUN] [PC] Sending handshake initiation to peer 1 (3.***.***.93:1**2)
2022-03-19 19:00:18.544: [TUN] [PC] Retrying handshake with peer 1 (3.***.***.93:1**2) because we stopped hearing back after 15 seconds 
2022-03-19 19:00:24.432: [TUN] [PC] Handshake for peer 1 (3.***.***.93:1**2) did not complete after 5 seconds, retrying (try 2)

and so on

哦,其他 VPN 解决方案(如 OpenVPN)运行良好。问题出在 WireGuard

答案1

警告:已启用 Forwarding/WeakHostSend,这将导致路由循环

亚历克斯·摩尔回答。帮助了我

Get-NetIPInterface | select ifIndex,InterfaceAlias,AddressFamily,ConnectionState,Forwarding | Sort-Object -Property IfIndex | Format-Table

Set-NetIPInterface -ifindex <required interface index from table> -Forwarding Disabled

相关内容