How to let firewall allow a program

Updated: 12/05/2021 by

How to let firewall allow a program

When a program or game requires access to the Internet or another network computer, it must be able to send information over a network port. A firewall protects a computer from unauthorized access and blocks all unnecessary network ports, which prevents a network program from communicating with another computer. Select your computers Windows version from the links below, and follow the steps to allow access to a program through the Windows Firewall.

Note

Administrator privileges are required to modify program access through the Windows Firewall.

Opening a port in the Windows 11 Firewall

Tip

If you're trying to allow access to a multiplayer computer game when the game is run, the Windows Firewall prompts you to allow that program to access the Internet.

  1. Open the Control Panel.
  2. Under Windows Defender Firewall, click the Allow an app through Windows Firewall link.
  3. If the Windows Defender Firewall window is displayed, click Allow an app or feature through Windows Defender Firewall link in the left navigation menu to open a window like the picture below.

How to let firewall allow a program

  1. Click the Change settings button to make access changes for programs in the list.
  2. Check the box for the program you want to grant to access through the Windows Firewall. If you play a network game in your local network, only check the Home/Work (Private) box. If you need the program to have Internet access, check the Public box.

Opening a port in the Windows 8 and Windows 10 Firewall

Tip

If you're trying to allow access to a multiplayer computer game, the Windows Firewall prompts you to allow that program to access the Internet when the game is run.

  1. Open the Control Panel.
  2. Click the System and Security option.
  3. Under Windows Firewall, click Allow a program or feature through Windows Firewall to open a window similar to the picture below.

How to let firewall allow a program

  1. Click the Change settings button to make access changes for programs in the list.
  2. Check the box for the program you want to grant access through the Windows Firewall. If you play a network game in your local network, only check the Home/Work (Private) box. If you need the program to have Internet access, check the Public box.

Opening a port in the Windows Vista and Windows 7 Firewall

Tip

If you're trying to allow access to a multiplayer computer game when the game is run, the Windows Firewall prompts you to allow that program to access the Internet.

  1. Click Start, type firewall in the Search for Programs and Files box, and click Windows Firewall in the found programs list.
  2. Click Allow a program or feature through Windows Firewall on the left column to open a window similar to the picture below.

How to let firewall allow a program

  1. Click the Change settings button to make access changes for programs in the list.
  2. Check the box for the program you want to grant access through the Windows Firewall. If you play a network game in your local network, only check the Home/Work (Private) box. If you need the program to have Internet access, check the Public box.

Windows XP users

Tip

If you're trying to allow access to a multiplayer computer game when the game is run, the Windows Firewall prompts you to allow that program to access the Internet.

  1. Open the Control Panel.
  2. Click Security Center and then Windows Firewall.
  3. Click Add Program to add a program you want to add as an exception to the Windows Firewall or Add Port if you know the port number you want to open.

How to let firewall allow a program

Contents

  • 1 How To Allow an App through Windows Defender Firewall via Windows Security Alert
  • 2 How to Allow a Program Through Windows Defender Firewall in Windows Firewall Settings
  • 3 How to Remove Allowed App in Windows Firewall Settings
  • 4 How to Allow or Block a Program from Accessing the Internet via Command Prompt
  • 5 How to Remove an Allowed App from Windows Defender Firewall with Command Prompt
  • 6 How to Allow or Block a Program in Windows Firewall via PowerShell
  • 7 How to Remove Allowed Windows Firewall App in PowerShell
  • 8 How to Open or Close a Port in Windows Firewall
  • 9 How to Perform a Network Reset

Windows Firewall, now known as Windows Defender Firewall, is a useful tool for a number of reasons. Though you can use it for several purposes, today we’re going to show you how to block a program from accessing the internet in Windows Firewall. We’ll also show you how to allow an app through Firewall if its connectivity isn’t working.

Allow or block internet access of programs and apps

Knowing how to block programs in Firewall is useful for several reasons. You may want to prevent it from receiving updates, stop it from sending data back to a remote server, or simply want to know how it functions offline.

Conversely, allowing a program through Windows Firewall can help it to function better online. This is especially true if anybody is connecting to your app from the outside world (such as when you’re hosting a game or media server). If you get the “your internet access is blocked – security or firewall settings might be blocking the connection” error, this is also useful, as it lets you return a blocked app to normal functioning.

The most user-friendly way to allow block an app in Firewall is, of course, via the Windows Defender Firewall app or security alert. However, we’ll also be showing you how to achieve the same effect via the command-line for pro users or those without a GUI.

How To Allow an App through Windows Defender Firewall via Windows Security Alert

The most efficient way to allow a program through a Firewall is to simply tick the right option when you first launch it. Most apps that need firewall access will ask you whether you want to allow access via a Windows Security Alert prompt. Here’s what you need to do when you see it:

  1. Tick “Private networks” and/or “Public networks” and click “Allows access”

    That’s it. You can easily see why this is the best method to allow an app through the firewall.

    How to let firewall allow a program

How to Allow a Program Through Windows Defender Firewall in Windows Firewall Settings

If you missed the Security Alert app shortly after you launched the app, you can stop Windows Firewall from blocking internet connectivity by adding it to your allowed list manually. This only takes a minute or so and is very simple through the Control Panel.

  1. Press the search icon and open Control Panel

    Press the search button on your taskbar, type “Control Panel”, and click the top result.

    How to let firewall allow a program

  2. Type “Windows Firewall” in the Control Panel search and choose “Windows Defender Firewall” in the main list

    How to let firewall allow a program

  3. Click “Allow an app or feature through Windows Defender Firewall”

    This option will be the sidebar on the left.

    How to let firewall allow a program

  4. Press “Change settings” in the “Allowed apps” window

    Allowing a program in Firewall requires you to provide administrator access.

    How to let firewall allow a program

  5. Press “Allow another app…” at the bottom of the window

    How to let firewall allow a program

  6. Next to the “Path” box, press “Browse…”

    How to let firewall allow a program

  7. Browse to your applications .exe, click it, and press “Open”

    How to let firewall allow a program

  8. Click the “Network types…” button in the bottom-left

    How to let firewall allow a program

  9. Tick “Private” and/or “Public” networks and press “OK”

    How to let firewall allow a program

  10. Press “Add” to allow the app through Firewall

    How to let firewall allow a program

  11. Find the program in your “Allowed apps” list and make sure it’s ticked

    Press “OK” when you’re done to close the window.

    How to let firewall allow a program

How to Remove Allowed App in Windows Firewall Settings

If you previously allowed an app through Firewall but now regret it, you can rectify it by removing it in Windows Firewall settings. Thankfully, this is pretty easy to do:

  1. Open Control Panel

    Press the search icon and type “Control Panel”, then click the top result.

    How to let firewall allow a program

  2. Search Control Panel for Windows Firewall and select it from the list

    How to let firewall allow a program

  3. Press “Allow an app or feature…” in the sidebar

    How to let firewall allow a program

  4. Click “Change settings” and provide admin privileges

    How to let firewall allow a program

  5. Find the program in your allowed apps list, click it, and press “Remove”

    How to let firewall allow a program

  6. Press “Yes” to the prompt

    That’s it, the app is no longer allowed through your firewall. Doing this will not automatically block internet access to a program, but will modify how it interacts with the outside world. Depending on its function, this may stop it from working properly.

    How to let firewall allow a program

  7. Press “OK” in the “Allowed apps” window

    How to let firewall allow a program

How to Allow or Block a Program from Accessing the Internet via Command Prompt

If you prefer the command-line, you can change Windows Firewall rules through Command Prompt instead. This is typically faster than jumping through the settings menu if you have the commands memorized. Here’s what you need to do:

  1. Open Command Prompt as an admin

    Press the search icon on your taskbar and type “Command Prompt”, then right-click it and press “Run as administrator”

    How to let firewall allow a program

  2. Use the netsh command to allow a program through Windows Firewall in Command Prompt

    Here’s an example of what you’d type to allow an app through the Firewall in Windows 11 or 10:

    netsh advfirewall add rule name="Firefox" dir=in action=allow program="C:/Program Files/Mozilla Firefox/firefox.exe" enable=yes

    You should change in quotation marks to fit the specific program you’re trying to allow. After performing this change, you should no longer receive the “security or firewall settings might be blocking the connection” error.

    How to let firewall allow a program

  3. Use netsh to block a program in Windows Firewall

    If you’d rather block the program, the command is very similar to above. You just have to switch action=allow to action=block. Here’s what the full command looks like:

    netsh advfirewall firewall add rule name="Firefox" dir=in action=block program="C:/Program Files/Mozilla Firefox/firefox.exe" enable=yes

    Again, you should change everything that’s in quotation marks to suit the app you’re trying to block internet access to in Firewall.

    How to let firewall allow a program

How to Remove an Allowed App from Windows Defender Firewall with Command Prompt

You can also use Command Prompt to remove apps that you’ve previously allowed in your Firewall. Here’s how:

  1. Open Command Prompt as an administrator

    Press the search icon on your taskbar and type “Command Prompt”, then right-click the top result and choose “Run as administrator”.

    How to let firewall allow a program

  2. Run the show rule command to export a list of your firewall entries

    To do so, simply paste the following into your Command Prompt and press Enter:

    netsh advfirewall firewall show rule name=all >"%UserProfile%/Desktop/WindowsFirewallRules.text"

    How to let firewall allow a program

  3. Open the “WindowsFirewallRules.txt” file on your desktop and find your application

    You’ll see the name of the rule you created next to the “Rule Name” field. If you’re struggling to find your rule, you can press Ctrl + F to search.

    How to let firewall allow a program

  4. Use the netsh command to delete the firewall rule

    Once you know the name of your firewall rule you can delete it by running the following command:

    netsh advfirewall Delete rule name="yourfirewallrule"

    Naturally, you should replace “yourfirewallrule” with the name of your rule. After you receive the “Deleted x rule(s)” confirmation, you can close Command Prompt.

    How to let firewall allow a program

If you want to allow or block a program in Firewall using Microsoft’s more modern PowerShell tool, you can do so with the NetFirewallRule command. Here’s how:

  1. Open Windows PowerShell as an admin

    The easiest way to do this is to open the hidden Start menu by pressing “Windows + X” and then clicking “Windows PowerShell (Admin)”.

    How to let firewall allow a program

  2. Use NetFirewallRule to allow a program through the Firewall

    If you want to allow an app, your command should look something like this:

    New-NetFirewallRule -DisplayName "firewallrulename" -Direction Inbound -Program "C:/path/to/your/file.exe" -Action Allow

    Replace “firewallrulename” with whatever you’d like your rule to be called, and “C:/path/to/your/file.exe” with the path to your program’s executable. Press Enter to run the command.

    How to let firewall allow a program

  3. Use NetFirewallRule to block a program in Windows Firewall

    If you want to block an app, your command should look something like this:

    New-NetFirewallRule -DisplayName "firewallrulename" -Direction Inbound -Program "C:/path/to/your/file.exe" -Action Block

    Replace “firewallrulename” with whatever you’d like your rule to be called, and “C:/path/to/your/file.exe” with the path to your program’s executable. Press Enter to run the command.

    How to let firewall allow a program

How to Remove Allowed Windows Firewall App in PowerShell

If you previously added an app to the Firewall via PowerShell but now want to remove, it the process is relatively simple:

  1. Open PowerShell as an admin

    The easiest way to do this is to open the hidden Start menu by pressing “Windows + X” and then clicking “Windows PowerShell (Admin)”.

    How to let firewall allow a program

  2. Export a list of your Firewall rules

    Before you can stop allowing a program in Firewall you need to know its rule name. You can obtain this by exporting a list of all of your Firewall rules to your desktop. Just run the following command to do so:

    Show-NetFirewallRule | Out-File "$env:userprofile/Desktop/WindowsFirewallRules.txt"

    How to let firewall allow a program

  3. Open “WindowsFirewallRules.txt” from your desktop and find your rule name

    The rule name will be in the column next to the “DisplayName” label. Note it down ready for the next command.

    How to let firewall allow a program

  4. Remove the rule with PowerShell

    Now that you know the rule name, it’s a simple process of running the following command:

    Remove-NetFirewallRule -DisplayName "YourRule"

    Naturally you need to replace “YourRule” with the name of your actual rule.

    How to let firewall allow a program

How to Open or Close a Port in Windows Firewall

How to let firewall allow a program

As well as allowing and blocking applications, Windows Defender Firewall lets you open and close specific ports. This may be useful if you’re trying to use SSH for example. You can check our how to open or close a port in Windows Firewall guide to learn how.

How to Perform a Network Reset

How to let firewall allow a program
If you’re still experiencing connectivity issues after allowing an app through your Firewall, you can try performing a Windows Network reset. This will reset all of your settings to default and hopefully fix any strange behavior you’ve been experiencing. It will, however, keep your Firewall rules.

How do I allow a firewall to allow certain apps?

Select the Start menu, type Allow an app through Windows Firewall, and select it from the list of results. Select Change settings. You might be asked for an administrator password or to confirm your choice. To add an app, select the check box next to the app, or select Allow another app and enter the path for the app.

How do I stop firewall from blocking a program?

To manage the whitelist in the Windows Firewall, click Start, type firewall and click Windows Defender Firewall. Click Allow a program or feature through Windows Firewall (or, if you're using Windows 10, click Allow an app or feature through Windows Firewall).

How do I add programs to my firewall whitelist?

Open the “Start” menu..
Click on “Settings.”.
In the “Find a Setting” search box, type in “Firewall.”.
Click on “Windows Firewall.”.
On the left, click on “Allow an app or feature through Windows Firewall.”.
Now, the “Allowed App” windows will pop up..

How do I firewall a program?

How to Block a Program with Windows Firewall Windows 10.
Open Windows Firewall window..
Click Advanced settings..
Enter into Firewall rule creation window..
Create a new Firewall rule..
Select the target program..
Name the Firewall rule..
You can click Start and type Windows Defender Firewall..