Would you like to learn how to block an IP address on Windows? In this tutorial, we will show you how to configure the Windows firewall to block IP addresses on a computer running Windows.

• Windows 2019
• Windows 2016
• Windows 2012 R2
• Windows 10
• Windows 7

Equipment list

Here you can find the list of equipment used to create this tutorial.

This link will also show the software list used to create this tutorial.

Windows Related Tutorial:

On this page, we offer quick access to a list of tutorials related to Windows.

Tutorial Windows - Block IP address using the command-line

As an administrator, start an elevated command prompt.

Windows - Elevated command prompt

Configure the Windows firewall service to start automatically.

Copy to Clipboard

Start the Windows firewall service.

Copy to Clipboard

Enable the Windows firewall profiles.

Copy to Clipboard

Create a firewall rule to deny the input of packets from a specific IP address.

Copy to Clipboard

In our example, we configured the Windows Firewall to block the input of packets coming from the IP address 10.10.10.10.

Create a firewall rule to deny the output of packets to a specific IP address.

Copy to Clipboard

In our example, we configured the Windows firewall to block the output of packets sent to the IP address 10.10.10.10.

Congratulations! You configured the Windows firewall to block an IP address.

Tutorial Powershell - Block IP address on Windows

As an Administrator, start an elevated version of the Powershell command-line.

Windows 10 - powershell elevated

Configure the Windows firewall service to start automatically.

Copy to Clipboard

Start the Windows firewall service.

Copy to Clipboard

Enable the Windows firewall profiles.

Copy to Clipboard

Create a firewall rule to deny the input of packets from a specific IP address using Powershell.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

In our example, we configured the Windows Firewall to block the input of packets coming from the IP address 10.10.10.10.

Create a firewall rule to deny the output of packets to a specific IP address using Powershell.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

In our example, we configured the Windows Firewall to block the output of packets sent to the IP address 10.10.10.10.

Congratulations! You configured the Windows firewall to block an IP address using Powershell.

Tutorial Windows - Verify the firewall configuration

Start the application named Windows Defender Firewall with Advanced Security.

Windows Defender Firewall with Advanced Security

Verify the input rule blocking the IP address.

Windows firewall - Block IP address using Command-line

Verify the output rule blocking the IP address.

Windows firewall - Block IP address using powershell

You are able to verify the firewall configuration.