具有高级安全性的 Windows 防火墙中的命令行 IP 阻止/解除阻止 [英] CommandLine IP block / unblock in Windows Firewall with Advanced Security

查看:15
本文介绍了具有高级安全性的 Windows 防火墙中的命令行 IP 阻止/解除阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够以编程方式阻止发往某些 IP 的传出数据包.没关系应用程序,我希望能够做到.

I'd like to programmatically be able to block outgoing packets to some IPs. Nevermind the application, I would like to be able to do it.

我使用的是 Windows 7 x64 Professional,因此它配备了具有出站过滤功能的高级安全 Windows 防火墙.

I have Windows 7 x64 Professional so it comes with WindowsFirewall with Advanced Security which has an outbound filter capability.

目前我正在手动添加规则来阻止 IP,但必须有更好的方法.

Currently I'm manually adding rules to block an IP, but there has got to be a better way.

我读到:任何方式关闭互联网"在 Windows 中使用 c#?http://msdn.microsoft.com/en-us/library/bb945065.aspx 所以我知道可以编写这样的应用程序.

I read this: Any way to turn the "internet off" in windows using c#? and http://msdn.microsoft.com/en-us/library/bb945065.aspx so I know it's possible to write such applications.

我是一名 Java 程序员,我找不到与 firewall.dll 交互的 jni.我对 C# 一无所知,自己写一个.

I'm a java programmer, and I couldn't find an jni to interface with firewall.dll. I don't know anything about C# to write one myself.

我在问是否有一个工具可以做到这一点,请告诉我.我已经谷歌搜索和谷歌搜索,但唉 - 什么都没有.如果没有,请让我开始学习如何自己编写.

I'm asking if there a - there's a tool out there that can do this, please let me know about it. I've Googled and Googled, but alas - nothing. If there isn't please get me started on how to write it myself.

如果你觉得很慷慨,你可以为我写一篇 st.t.您可以阻止到 IP 的出站流量并取消阻止它.

In case you're feeling generous, you could write one for me s.t. you could block outbound traffic to an IP and unblock it.

非常感谢大家.

推荐答案

最直接的方法就是运行 netsh,这是一篇关于如何做到这一点的文章

The most straightforward way would be just to run netsh, here's an article on how to do it

这篇关于具有高级安全性的 Windows 防火墙中的命令行 IP 阻止/解除阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆