Lock / Unlock CommandLine IP Block in Windows Firewall with Advanced Security

I want to programmatically block outgoing packets for some IP addresses. Do not pay attention to the application, I would like it to be possible.

I have Windows 7 x64 Professional, so it comes with WindowsFirewall with advanced security, which has the ability to filter outgoing messages.

I am currently manually adding rules to block the IP address, but there should be a better way.

I read the following: Any way to disable "internet off" in windows using C #? and http://msdn.microsoft.com/en-us/library/bb945065.aspx , so I know that you can write such applications.

I am a Java programmer and I could not find jni to interact with firewall.dll. I don't know anything about C # to write myself.

I ask if there is a tool there that can do this, let me know. I am Googled and Googled, but alas - nothing. If not, please make me start writing about myself.

If you feel generous, you can write one for me st you can block outgoing traffic on IP and unlock it.

Thank you very much.

+3
source share
2 answers

The easiest way is to simply run netsh, here's an article on how to do it

+2
source
0

Source: https://habr.com/ru/post/1780995/


All Articles