How To Check if a Port Is Blocked by Windows Firewall

Cannot use a network port in Windows? Windows Firewall might be blocking it. Here is how to check if a port is blocked by Windows Firewall.

Windows Firewall is enabled by default to manage network connections and protect you from unwanted traffic. One of the best things about the Windows Firewall is that it is highly configurable. Windows Firewall allows all outgoing connections and incoming connections that directly respond to the outgoing connections in its default configuration.

Often, specific programs require specific ports to be open and functional. For example, if you are running a media server, it needs a particular port to be open. If the port is blocked for any reason, the media server cannot transmit data. There are two main reasons why a port is blocked. First, it might be that a different program is using the target port. Second, Windows Firewall is actively blocking the port so that no program can use it.

Generally, Windows Firewall doesn’t arbitrarily block a port. However, Windows Firewall can block a port if you have misconfigured it or if a program changed the Firewall settings. In that case, you have to unblock the port in Windows Firewall manually.

When you cannot use a specific port, the first troubleshooting step you should follow is to check if the Windows Firewall is blocking the port. That way, you can narrow down the problem.

In this quick and straightforward Windows guide, let me show you how to check if Windows Firewall blocks a port.

Check if a port is blocked by Windows Firewall

To know if Windows Firewall is blocking a port, we need to create a firewall log that lists all the ports and their status. The log file will make it easy to find if any port is blocked. Here is how to do it.

First, we need to open Advanced Firewall Settings. To do that, search for “Windows Defender Firewall” and open it. In the Windows Firewall, click the “Advanced Settings” link on the sidebar.

Now, select the “Windows Defender Firewall with Advanced Security on Local Computer” option on the sidebar.

Windows Firewall advanced settings

Next, click on the “Action > Properties” option. It will open the Windows Firewall properties window.

open Windows firewall properties

In the Properties window, select the profile tab you want to check if a port is blocked. In my case, I want to check if the port is blocked in the Private profile. Here, click the “Customize” button in the “Logging” section.

customize logging

In the customize window, select “Yes” from the “Log dropped packets” dropdown menu. Click the “Ok” button to save the changes. This action will start the logging process. If you are wondering, when Windows Firewall blocks a port, all the packets are dropped to and from that port. When that happens, it is automatically logged to the file. By looking at the log, we can determine if a port is blocked.

check if a port is blocked by Windows firewall

Now, open the File Explorer, paste the following location in the address bar, and press Enter.

C:\Windows\System32\LogFiles\Firewall

Double-click on the “pfirewall.log” file to see blocked ports. If you don’t see any ports in this file, then Windows Firewall is not blocking ports.

Important note: Sometimes, you might have to restart the system and/or use the application that uses the port you want to check. If no communication occurs in the target port, there won’t be any dropped packets, and in turn, it will not be logged in the pfirewall.log file.

That is all. It is that simple to check if a port is blocked by Windows Firewall.

I hope that helps.

If you need help, comment below.

Leave a Comment

Scroll to Top