How to Add Windows Firewall Rule

How to Add Windows Firewall Rule

Windows Firewall is a built-in security application by Microsoft that protects the system from network-based threats. The software provides two-way protection to the system by blocking the traffic flowing into or out of the device. Firewall rules are an important part of this security system. They help in determining what kind of traffic is safe to enter and exit the network. These rules can either be assigned to a policy or directly to a computer. To add Windows Firewall rule can be tricky but our guide will help you in doing so without any difficulty or confusion. Also, you will learn a great deal about its components, inbound outbound rules, and how to set Firewall rules. So, without further ado let us get started!

How to Add Windows Firewall Rule

How to Add Windows Defender Firewall Rule?

As we already know, a Firewall helps in providing security to systems and their data from malicious sources. If, however, proper configuration of the Firewall is not done, everything might go in vain.

What is Firewall Configuration?

Firewall configuration involves configuring IP addresses, domain names, and completing other important actions to keep the Firewall secure. Three important Firewall configurations that prevent from data leakage and cyberattacks are:

  • Packet Filters
  • Stateful Inspection
  • Proxy Server Firewalls

What are Components of Firewall?

A Firewall is pre-programmed software with security features that notice and block any & all possible threats. All these features collectively provide multi-layered protection that acts as defense security in modern firewall networks. These components of Firewall include:

  • Routing
  • Malware prevention
  • Data packet filtering
  • Remote access
  • Network access control
  • Spam and phishing protection
  • Web filtering
  • Encryption

Inbound Outbound Rules of Windows Defender Firewall

  • Inbound rules in Firewall are applied to the incoming network traffic coming to the computer
  • whereas outbound rules apply to the traffic that goes out from the computer.

Both, Inbound outbound rules of Firewall, are served by the pre-installed Windows Defender Firewall on a Windows PC.

How to Set Firewall Rules?

Firewall rules help to examine and control information in individual packets. These rules can control or block this information from entering or leaving your computer depending upon the criteria that are defined by you. Hence, setting Firewall rules is quite helpful.

You can create a new rule by following the detailed steps listed below.

Step I: Access Firewall Interface

The first method to add Windows Firewall rule is to first access Windows Firewall with Advanced Security window interface. One of these common ways to access it is from the control panel as follows:

1. Click on the Windows search bar on your PC, type Control Panel in it, and click on Open.

Open Control Panel | How to Add Windows Firewall Rule

2. Now, locate and click on Windows Defender Firewall.

Click on Windows Defender Firewall

3. Next, select Advanced settings from the side panel to access Windows Defender Firewall with Advanced Security window.

Select Advanced settings

Also Read: How to Block or Unblock Programs In Windows Defender Firewall

Step II: Configure Network Profiles

Now that you have accessed the Advanced Security window of Windows Firewall, it is time to configure network profiles. There are three different profiles:

  • Domain Profile which is used when the system is connected to a domain,
  • Private Profile which is used in case the computer is connected to a private network, like home or work, and
  • Public which is used when the system is connected to a public network like coffee shop Wi-Fi.

Different systems can choose a different profile or even a single computer can use all three profiles in a single day depending upon user’s requirements. Therefore, it is one of the basic steps in the process of how to set or add Windows Firewall rules.

You can follow the steps below to check network profiles:

Note: Blocking Outbound connections will also stop notifications when a program is blocked.

1. Follow the steps mentioned in Method 1 to open Windows Defender Firewall with Advanced Security window.

Open Windows Defender Firewall with Advanced Security window | How to Add Windows Firewall Rule

2. Now, click on Windows Defender Firewall Properties link.

Click on Windows Defender Firewall Properties

3. The new window contains a separate tab for each profile. You can choose a profile of your choice for example, Domain Profile selected below.

4. Choose Block or Allow (default) option from drop-down menu in respect of:

  • Inbound connections
  • Outbound connections
  • Protected network connections

Choose a profile of your choice and Block or Allow Inbound or Outbound

5. Once done, click on Apply > OK.

Click on OK

Also Read: Fix Windows 10 Network Profile Missing Problem

Step III: Create a Rule

Windows Firewall offers four types of rules which include the following:

  • Program which tends to block or allow a program,
  • Port that blocks or allows a port, port range, or protocol,
  • Predefined which uses a predefined Firewall rule included with Windows, and
  • lastly, Custom which specifies a combination of program, port, and IP address to either block or allow it.

Now, to create a rule, you would need to select the Inbound Rules or Outbound Rules category and then create a new rule. You can follow the steps below to create one on your PC:

1. In Windows Defender Firewall with Advanced Security window, and click on Outbound Rules from the left panel.

Click on Outbound Rules | How to Add Windows Firewall Rule

2. Next, click on New Rule… from the right panel.

Click on New Rule

3. New Outbound Rule Wizard will open in which you will find different rule types as described earlier

New Outbound Rule Wizard window will open

4. Now, to control a program, select Program from the options and click on Next.

Select Program from the options and click on Next

5. Using the Browse… button, select the desired program .exe file, and click on Next as depicted below.

Browse a file and click on Next

6. Select Block the connection option and click on Next as shown.

Select Block the connection and click on Next

7. On the next screen, check all the boxes marked Domain, Private, Public, and click on Next.

Check all the boxes and click on Next | How to Add Windows Firewall Rule

8. In the next window, enter Name of the rule and give its optional Description. Then, click on Next.

The rule that you created will take effect immediately and will appear in the list for you to disable or delete easily. 

Also Read: Fix Windows Firewall problems in Windows 10

Step IV: Restrict Access

You can also restrict access to lock down a program in the Inbound Outbound rules Firewall. This will help you to restrict ports and IP addresses it usually connects to. The following steps will help you to restrict access to a program in Windows Defender Firewall:

1. Click on Inbound Rules from the side panel in the Windows Defender Firewall with Advanced Security window.

Click on Inbound Rules

2. Now, select New Rule… from right pane as shown.

Select New Rule

3. Select Custom and click on Next.

Select Custom and click on Next

4. In This program path field, click on Browse… to select .exe file. Then, click on Next.

Click on Browse to select a file and then click on Next

5. Next, select a Protocol type and Local port and click Next.

Note: In case you are running a web server application, select TCP, and enter 80, 443 in the Local port box.

Select Protocol type, Local port, and click on Next | How to Add Windows Firewall Rule

6. Under Scope tab, you can restrict IP addresses as well. Enter the IP address in Which local IP addresses does this rule apply to? field in case you want the server to communicate with a specific IP address. Again, click on Next.

Add remote IP address and click on Next

7. Now, select Allow the connection and then click on Next to apply the rule immediately. This is how you can add Windows Firewall rule.

Select Allow the connection and click on Next | How to Add Windows Firewall Rule

Frequently Asked Questions (FAQs)

Q1. What are the requirements to configure a Firewall?

Ans. The requirements to configure a Firewall include:

  • Securing the Firewall
  • Establishing Firewall zones and IP address structure
  • Configuring Access Control Lists
  • Configuring other Firewall services and logging
  • Testing the Firewall configuration
  • Finally, managing the Firewall continually

Q2. Do Firewall rules take effect immediately?

Ans. Yes, Firewall rules take effect immediately after you apply them. Whether it’s blocking the traffic coming in the system or going out, every rule gets the job done immediately after it is applied.

Q3. Can I disable or delete the Firewall rules?

Ans. Yes, you can set, enable, disable or delete Firewall rules from the list that you have created.

Q4. Is port 443 secure?

Ans. Yes, port 443 is secure as the information that travels on port 443 is usually encrypted using Secure Sockets Layer and Transport Layer Security; thereby, making it a safe multi-layered port.

Q5. Why is Firewall important?

Ans. A Firewall is extremely important as it prevents hackers or other malicious activities from gaining unauthorized access to the system data files, or other important data. Hence, always make sure that it is enabled & Firewall configuration is proper.

Recommended:

Windows Defender Firewall is indeed a tricky application to use but we hope that our guide has made it possible for you to gain an insight into how to set or add Windows Firewall rule. Let us know about your suggestions and queries, if any, in the comments section below.

Posted by
Pete Mitchell

Pete is a Senior staff writer at TechCult. Pete loves all things technology and is also an avid DIYer at heart. He has a decade of experience writing how-tos, features, and technology guides on the internet.

Leave a Reply

Your email address will not be published.