HOWTO: Block or Allow TCP/IP Port in Windows Firewall

Windows Firewall allows you to restrict outgoing / incoming network traffic for a specific application or TCP / IP port, and is a popular means of restricting network access to (from) user workstations or servers. Windows Firewall rules can be configured individually on each computer, or, if the user's computer is in a Windows domain, the administrator can manage the settings and rules of Windows Firewall using group policies.

In large organizations, port filtering rules are usually brought to the level of a router, L3 switches, or dedicated firewalls. However, nothing prevents you from spreading your Windows Firewall network access restriction rules to Windows workstations or servers.

According to your needs, you can configure Windows Firewall settings (block or open port in Windows 10/8/7) and restore defaults if you are unsatisfied with the default Windows Firewall settings. However, for this, you need to get to the advanced settings of the firewall. This is simple, simply open up the control panel and in its search box type – Firewall. Then open Firewall and click on its ‘Advanced Settings’ link. In this post, we will see in detail how to block or open a port in Windows 10/8/7 firewall

1. Open Windows Firewall and Choose Advanced Settings

Open the firewall: one of the ways - in the search bar or in the menu, type firewall.cpl and press the Enter key.

Step 1 to Block Windows Firewall port is to Open Windows Firewall and Choose Advanced Settings

When in the ‘Advanced Settings’ of Windows firewall, click the Advanced settings link in the left-hand pane of the main firewall dialog. This will bring up the Windows Firewall with Advanced Security window.

The next step to Block Windows Firewall port is to choose Windows Firewall Advanced Settings

2. The next Step Is to Select Inbound Rules

Now, if you see the firewall window shows a list of rules on the left side. From the list, select and click Inbound Rules to display the inbound rules section.

Step 2 to Block Windows Firewall port is to Select Inbound Rules

3. Then Select the ‘new Rule’ Option

Then, from the right pane select the ‘New Rule’ option.

Step 3 to Block Windows Firewall port is to Select the ‘new Rule’ Option

4. Select Port and Click Next Button

Doing so will open the ‘New Inbound Rule Wizard’ window. From it, select ‘Port’ as the new Rule Type and click Next. For safety purposes, I tried blocking TCP port. Click on Specific local ports. Then choose one port number like 80.

Step 4 to Block Windows Firewall port is to Select Port

Click Next to continue.

5. Specify the Action ‘Block the connection’

Next, select ‘Block the connection’ as the Action and click Next.

Step 5 is to Select Block the connection

6. Select All the Profiles Available in the Next Window

Later, select all the profiles available for different type of connections (Domain, Private and Public) and Click Next to continue.

Step 6 is to Select All the Profiles Available

7.Give a Name of Your Choice to the New Rule.png

Give a name of your choice to the new rule. I used ‘block suspicious ports’. If you want, you can add the description to the new rule. This step is however optional. Finally, click the Finish button to configure the settings.

Step 7 is to Give a Name of Your Choice to the New Rule

8. Steps to Open Port in Windows Firewall

At times, you may you may feel the need of opening a port in the Windows firewall to let a specific IP communicate with your computer. For example, while playing games. The procedure to open a port remains more or less the same. All you need to do is follow the instructions in the New Inbound Rule wizard, specify the Port and select Allow the connection.

Also consider using Action1 to block or allow TCP/IP port remotely if:

  • - You need to perform this action on multiple (hundreds or even thousands) computers simultaneously.
  • - Some of your endpoints are laptops not connected to corporate network at all times.

Action1 is a cloud-based platform for software deployment, software/hardware inventory, patch management, endpoint configuration and more. It is free with basic functionality.

Other Relevant HOWTOs: