windows 用cmd开启防火墙ping

 
更多

Windows 允许 Ping 请求
1. 命令行方式
1.1. 允许请求
# 允许 ICMPv4 请求
netsh advfirewall firewall add rule name=”ICMP Allow incoming V4 echo request” protocol=icmpv4:8,any dir=in action=allow
# 允许 ICMPv6 请求
netsh advfirewall firewall add rule name=”ICMP Allow incoming V6 echo request” protocol=icmpv6:8,any dir=in action=allow
1.2. 禁用请求
实质上是添加了一条新规则对旧规则进行覆盖

# 禁用 ICMPv4 请求
netsh advfirewall firewall add rule name=”ICMP Allow incoming V4 echo request” protocol=icmpv4:8,any dir=in action=block
# 禁用 ICMPv6 请求
netsh advfirewall firewall add rule name=”ICMP Allow incoming V6 echo request” protocol=icmpv6:8,any dir=in action=block
1.3. 删除规则
!会删除所有匹配的规则,请谨慎使用

具体用法可以参考:netsh advfirewall firewall delete rule ?

# 删除规则
netsh advfirewall firewall delete rule name=”ICMP Allow incoming V4 echo request” protocol=icmpv4:8,any dir=in

打赏

本文固定链接: https://www.cxy163.net/archives/2227 | 绝缘体

该日志由 绝缘体.. 于 2022年11月22日 发表在 首页 分类下,
原创文章转载请注明: windows 用cmd开启防火墙ping | 绝缘体

报歉!评论已关闭.