How to Use the Firewall in Windows

Windows Firewall on laptop

The Windows Firewall (also known as Windows Defender Firewall in more recent versions of Windows) is a security feature designed to protect your computer from unauthorized access and malicious network activity. It also acts as a barrier between your computer and the Internet or other networks, allowing you to control which programs or services can communicate over the network. This tutorial shows how to use the Windows Firewall, configure it for enhanced security, and restore its default settings.

Good to know: did you know that you can use Windows Security straight from the Command Prompt? We show you how.

Enable or Disable Windows Firewall

By default, Microsoft Defender Firewall is enabled on your PC. It’s a component of the Windows Security app, which provides additional features, such as antivirus protection, app & browser control, account protection, and more.

Since the Microsoft Defender Firewall is already on, you don’t need to do anything to activate it. It will run in the background, keeping your PC safe.

If you need to turn the Windows Firewall off as a troubleshooting approach, for instance, you can do so by following these instructions.

Press Win + I on your keyboard to launch the Settings app. Select Privacy & security -> Windows Security from the left pane.

Selecting "Windows Security" under "Privacy & security" in Windows Settings.

Select Firewall & network protection to launch the Windows Security app, where you can adjust your firewall settings. Click Domain network from the list of networks.

Selecting "Domain network" in firewall settings

Toggle the slider off under Microsoft Defender Firewall.

Turning off the Microsoft Defender Firewall toggle in Windows Security app.

In the User Account Control dialog box, choose Yes to confirm the changes. Repeat the same steps for Private network and Public network.

For Windows 10, you’ll need to navigate to Settings -> Update & Security -> Windows Security. Select Firewall & network protection from there.

In the Windows Security app, you will see a warning prompt the moment you turn off the firewall for any network category listed. Quickly reverse these changes by clicking the Restore settings button.

Restoring firewall settings when a firewall is detected to be turned off

Tip: there can be times when the Windows Security app isn’t working on your PC. Try implementing some of these solutions.

Use Shields Up Mode

If you’ve noticed suspicious activity on your network and suspect it is caused by an active attack, adjust your firewall settings to increase protection.

This is possible with the so-called Shields Up mode, which allows you to block all incoming connections to your Windows machine, as well as those in the list of allowed apps setting in Windows Security.

By default, the Microsoft Defender Firewall blocks all connections, except those with applied exception rules that allow certain traffic to override the general settings of your firewall. When enabled, Shields Up mode will ignore these exceptions until you disable it.

Via Windows Security

Open Windows Security -> Firewall & network protection as shown above. Choose a network. (For this example, we selected Domain network.)

Scroll down to Incoming connections, and tick the checkbox next to Blocks all incoming connections, including those in the list of allowed apps.

Enabling Firewall to block all incoming connections for enhanced protection in Windows Security app.

Confirm your choice in the User Account Control dialog box by clicking Yes. Tick the same checkbox for all other network categories.

Tip: learn how to set up a firewall on your Linux system.

From Control Panel

Alternatively, you can also control the Shields Up mode by going through the Control Panel.

Launch the Control Panel on your PC and click System and Security. Select Windows Defender Firewall from the list. Select Change notification settings on the left.

Clicking "Change firewall notification settings" in the Control Panel.

Under each network category on the next page, tick the checkboxes next to Block all incoming connections, including those in the list of allowed apps.

Checking options for "Block all incoming connections, including those in the list of allowed apps" in Control Panel.

Confirm that the Shields Up mode is on.

Incoming connections blocked in Control Panel.

Tip: learn how to permanently disable Windows Security.

Allow Programs Through the Windows Firewall

There are times when it’s necessary to manually allow programs through your firewall, especially if you’ve recently installed them. This gives you control over which applications are allowed to communicate over the network.

Launch the Windows Security app, and choose Firewall & network protection -> Allow an app through firewall.

Clicking on "Allow another app through firewall" from Windows Security app.

Click Change settings. Enable apps to go through the firewall by checking the associated boxes. To allow an app that isn’t included in the list by default, click Allow another app.

Clicking on "Allow another app" option under Windows Defender Firewall.

In the Add an app window, click Browse, or paste the app’s file path. Click Network types to choose whether you want to set it as private or public, then click Add to finish the process.

Clicking "Add" button to finish process of adding exception to firewall.

Alternatively, allow or block apps via the firewall by creating custom rules.

Restore the Windows Firewall

If you suspect that third-party software or malware has tampered with your firewall settings, restoring it to its default state can ensure the stability and security of your system. As previously mentioned, the default config provides well-rounded protection for most use cases.

Open Windows Security -> Firewall & network protection -> Restore firewalls to default.

Clicking on "Restore firewalls to default" in the Windows Security app.

Click the Restore defaults button in the next window to complete the process. Click Yes in the pop-up asking you if you want to continue.

Confirmation dialog box to proceed with restoring the firewall defaults.

Note that some of your apps may stop working once you agree, as they may get removed from the configured list of allowed apps in your Windows Firewall.

FYI: check out this list of effective third-party antivirus programs that you may want on your PC.

Staying Protected With the Windows Firewall

While firewalls help keep you safe, they’re not the only tool that will protect your computer. Consider enabling some key Windows Security settings to keep your PC safe.

Image credit: Pixabay. All screenshots by Princess Angolluan.

Is this post useful?
Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Princess Angolluan

Princess is a freelance writer based in Croatia. She used to work as an English teacher in Hokkaido, Japan before she finally changed careers and focused on content writing & copywriting, while running their own digital marketing company in Europe. For 5 years, she has written many articles and web pages on various niches like technology, finance, digital marketing, etc. Princess loves playing FPS games, watching anime, and singing.