window禁止本机访问某个IP, 模拟测试服务故障

以管理员身份运行cmd

添加规则,禁止访问111.13.101.208
netsh advfirewall firewall add rule name="Block URL" remoteip=111.13.101.208 dir=out enable=yes action=block

删除规则
netsh advfirewall firewall delete rule name="Block URL" 

查看规则
netsh advfirewall firewall show rule name = "Block URL"

参考
https://superuser.com/questions/1088998/netsh-command-to-block-url-from-firewall

猜你喜欢

转载自my.oschina.net/u/1263909/blog/1795423