Windows Server WireGuard接口无法被客户端Ping通的问题排查求助
Windows Server WireGuard接口无法被客户端Ping通的问题排查求助
我现在遇到一个WireGuard的网络问题,想请大家帮忙分析下:
我有一台Windows Server 2019标准版服务器,在公网环境下以监听模式运行WireGuard;家里还有一台Windows客户端也部署了WireGuard。
目前的情况是:服务器能正常Ping通客户端,但客户端反过来Ping服务器却完全不通。不过如果关掉服务器上的防火墙,客户端就能顺利Ping通服务器了。
我检查了「Windows Defender防火墙高级安全」面板,没发现有冲突的拦截规则。我还特意添加了一条允许规则,放开所有来源的ICMPv4协议流量——这条规则确实让服务器的公网IP能被正常Ping通,但通过WireGuard接口的Ping还是失败。
有没有大佬知道怎么配置防火墙,才能让它接受WireGuard创建的适配器上的入站ICMP数据包?
补充配置信息:
WireGuard服务器配置:
[Interface] PrivateKey = <priv key srv> ListenPort = 50001 Address = 172.16.60.1/32 [Peer] PublicKey = <pub key clt> AllowedIPs = 172.16.60.2/32 PersistentKeepalive = 5
WireGuard客户端配置:
[Interface] PrivateKey = <priv key clt> Address = 172.16.60.2/32 [Peer] PublicKey = <pub key srv> AllowedIPs = 172.16.60.1/32 Endpoint = <pub ip srv>:50001
我添加的那条能让公网Ping通但WireGuard不行的防火墙命令:
netsh advfirewall firewall add rule name="ping" protocol=ICMPV4 dir=in action=allow
备注:内容来源于stack exchange,提问作者grasbueschel




