We help IT Professionals succeed at work.

create a windows firewall rule to block connections.

I want to create a windows firewall rule to block a connect between an internal  Windows 2016 server to an external IP.  

Please advise how to do it.  

Thanks.
Comment
Watch Question

JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
Create an Inbound rule to block the IP. One rule for each IP.

Also use your router for this. May be better suited

Windows Firewall
Distinguished Expert 2019

Commented:
Inbound communications / outbound communications? Which ports or protocols? Most ports are opened with firewall rules for only the local network.

Author

Commented:
We run netstat on the server and see an external connection between the server and a host in the internet.  So we want to block outbound between server and this external host.  Thanks.
JohnBusiness Consultant (Owner)
Most Valuable Expert 2012
Expert of the Year 2018

Commented:
So then use the rule window above to do this.
Senior Consultant
Awarded 2017
Distinguished Expert 2019
Commented:
Run this
netsh advfirewall firewall add rule name="BLOCKED IP" interface=any dir=in action=block remoteip=REMOTE_IP_ADDRESS

Open in new window

https://www.experts-exchange.com/articles/31687/Windows-Firewall-as-Code.html