G
G
gibbonchik2017-08-16 13:33:08
cmd/bat
gibbonchik, 2017-08-16 13:33:08

How to use netsh to allow incoming and outgoing connections from only one IP address, and block from others?

Good day. I am writing my own add-on for OpenVPN and I need to allow incoming and outgoing connections from only one IP address (connected VPN server), and block all others.
Tried everything googled, does not help. The most logical solution is the command:

netsh advfirewall firewall add rule name="test" dir=in action=allow protocol=ANY remoteip=127.0.0.1
netsh advfirewall firewall add rule name="test" dir=out action=allow protocol=ANY remoteip=127.0.0.1

but with this code, all other connections are available.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question