How to reset Defender Firewall settings on Windows 11

Do you have mess of firewall rules? Here's how to reset the security feature to its default settings on Windows 11.

Windows 11 reset firewall settings
Windows 11 reset firewall settings / Image: Mauro Huculak
  • To reset the firewall settings on Windows 11, open Windows Security > Firewall & network protection, then click “Restore firewall to default” and confirm.
  • You can also reset the firewall using Command Prompt (netsh advfirewall reset) or PowerShell with a single command.

On Windows 11, if you’re using Microsoft Defender Firewall, there may come a time when you need to reset its settings to the default configuration, whether to troubleshoot and fix connectivity problems, resolve misconfigured rules, or clean up accumulated entries.

Regardless of the reason, the operating system gives you at least four ways to reset the firewall rules using the “Windows Security” app, “Windows Defender Firewall with Advanced Security” (Control Panel), Command Prompt, and PowerShell.

The built-in firewall on Windows 11 includes a core set of inbound and outbound rules designed to protect your system by managing traffic flow and blocking unauthorized access. However, as you install apps or create custom configurations, additional rules are added automatically or manually, which can eventually cause conflicts or unexpected behavior.

Resetting the firewall to its default state is a safe troubleshooting step when apps can’t connect to the network, network file sharing stops working, or you want to remove all user-defined rules and start fresh. However, this process doesn’t remove any of the system default firewall rules.

In this guide, I’ll outline the steps to reset the built-in firewall configuration to its default settings on Windows 11.

Warning: The steps below will remove all the settings you added to the firewall. If you have specific rules you want to restore later, you can use these instructions to export the firewall settings.

Reset firewall settings on Windows 11

To reset the settings for Microsoft Defender Firewall, use these steps:

  1. Open Windows Security on Windows 11.

  2. Click on Firewall & network protection.

  3. Click the “Restore firewall to default” option.

    Windows Security firewall reset default option

  4. Click the Restore default button.

    Control Panel Restore Defaults for firewall

  5. Click the Yes button.

Once you complete the steps, the Microsoft Defender Firewall user-defined settings will be deleted, and the default settings will be restored. If you have an app that depends on the firewall settings, you’ll have to reconfigure it.

Alternatively, you can also get to this page from Control Panel > System and Security > Windows Defender Firewall, and click the “Restore default” option from the left navigation pane.

Reset firewall settings using Advanced Security

To reset the Windows 11 firewall settings, use these steps:

  1. Open Windows Security.

  2. Click on Firewall & network protection.

  3. Click the Advanced settings option.

  4. Right-click the “Windows Defender Firewall with Advanced Security on Local Computer” item and select the “Restore Default Policy” option.

    Advanced Security Restore Default Policy option

  5. Click the Yes button.

  6. Click the OK button.

After you complete the steps, the custom firewall configurations will be overwritten by the default settings.

Reset firewall settings using PowerShell

To reset the Microsoft Defender Firewall using a PowerShell command, use these steps:

  1. Open Start.

  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.

  3. Type the following command to reset the Microsoft Default Firewall settings and press Enter:

    (New-Object -ComObject HNetCfg.FwPolicy2).RestoreLocalFirewallDefaults()

    PowerShell reset firewall command

Once you complete the steps, the PowerShell command will remove all the changes you made to the firewall since Windows 11 was installed.

Reset firewall settings using Command Prompt

To restore the default firewall settings with Command Prompt on Windows 11, use these steps:

  1. Open Start.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. Type the following command to reset the built-in firewall settings and press Enter:

    netsh advfirewall reset

    Command Prompt reset firewall

After you complete the steps, the command will delete the current Windows 11 firewall settings, and the original settings will be restored on the computer.

About the author

Mauro Huculak is a Windows How-To Expert and founder of Pureinfotech in 2010. With over 22 years as a technology writer and IT Specialist, Mauro specializes in Windows, software, and cross-platform systems such as Linux, Android, and macOS.

Certifications: Microsoft Certified Solutions Associate (MCSA), Cisco Certified Network Professional (CCNP), VMware Certified Professional (VCP), and CompTIA A+ and Network+.

Mauro is a recognized Microsoft MVP and has also been a long-time contributor to Windows Central.

You can follow him on YouTube, Threads, BlueSky, X (Twitter), LinkedIn and About.me. Email him at [email protected].