windows 禁止ping 和 允许 ping

以管理员身份启动 cmd.exe:

启用 ping:

netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow

禁用 ping:

netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=block

posted on 2022-12-28 17:57  空明流光  阅读(247)  评论(0编辑  收藏  举报

导航