Skip to content
Follow
Windows

How to Backup and Restore Microsoft Defender Firewall in Windows 11

Richard
Written by
Richard
Aug 8, 2025 Updated Sep 15, 2026 3 min read
How to Backup and Restore Microsoft Defender Firewall in Windows 11
How to Backup and Restore Microsoft Defender Firewall in Windows 11

Backing up and restoring Microsoft Defender Firewall rules in Windows 11 lets you save your custom security settings to a single file so you do not have to recreate them by hand. Microsoft Defender Firewall is the built-in security tool in Windows 11 that guards your PC by blocking unsafe network traffic.

Advertisement

Exporting your rules takes just a few clicks and protects your setup before a system reset or when you move to a new PC. You can import that backup file at any time to restore your exact firewall configuration instantly.

⚡ Quick Answer

To backup your Windows 11 firewall settings, open Windows Security, go to Firewall & network protection, then Advanced settings, and click Export Policy. To restore, return to Advanced settings and click Import Policy, then select your backup file.

Advertisement

Method 1Using Windows Security App

Windows Security app lets you backup Microsoft Defender Firewall settings without using any command-line tools. You can use this built-in menu to save your current firewall rules to a file on your computer. This protects your custom security rules so you can restore them later if your settings get reset or something goes wrong.

  1. Click the Start button on your taskbar .
  2. Select Settings from the menu.
windows 11 start menu settings updated
windows 11 start menu settings updated

  1. Click Privacy & security on the left side.
  2. Find the Windows Security tile and click it.
Windows Security button in Settings app for Firewall backup
Windows Security button in Settings app for Firewall backup

  1. Click the Open Windows Security button.
Open Windows Security button in Settings app
Open Windows Security button in Settings app

Advertisement
  1. In the Windows Security app, select Firewall & network protection. You can also use this shortcut: Firewall & network protection.
Click Firewall and network protection in Windows Security
Windows 11 Security app showing Firewall and network protection section.

  1. Scroll down and click the Advanced settings link at the bottom.
Advanced settings option in Windows Security app
Advanced settings option in Windows Security app

To Back Up Your Settings:

  1. In the window that opens, click Export Policy.
  2. Choose where you want to save your backup file.
  3. Give the file a name (it will be a .wfw file).
  4. Click Save.
Export or import Firewall settings in Windows 11
Export or import Firewall settings in Windows 11

To backup Microsoft Defender Firewall settings, you need to use the Export Policy option inside the Windows Security interface. This process saves all your active firewall rules into a single file with a .wfw extension. You can store this backup anywhere on your computer and use it later to restore your exact security configuration.

To Restore Your Settings:

  1. Go back to the Advanced settings window.
  2. Click Import Policy.
  3. Find your backup file and open it.
  4. Your firewall settings will be restored.

Method 2Using Command Prompt or PowerShell

Administrator privileges are required for this method.

Advertisement
  1. Open the Windows Terminal app as administrator.
  2. Choose either the Command Prompt or PowerShell tab.

To Back Up Your Settings:

Using Command Prompt:

💻Code
netsh advfirewall export "%userprofile%\Desktop\FirewallBackup.wfw"

Using PowerShell:

💻Code
netsh advfirewall export "$Env:USERPROFILE\Desktop\FirewallBackup.wfw"

This command creates a backup file named "FirewallBackup.wfw" directly on your Desktop. Your firewall settings are saved into a single file for future use.

To Restore Your Settings:

Execute this command in either Command Prompt or PowerShell:

Advertisement
💻Code
netsh advfirewall import "C:\Users\User\Desktop\FirewallBackup.wfw"

⚠️ Note: Remember to replace "C:\Users\User\Desktop\FirewallBackup.wfw" with the exact path to your backup file.

That completes the process.

Summary

Backing up Microsoft Defender Firewall settings in Windows 11 gives you a safe way to preserve your custom rules. You can use the graphical Windows Security app for a quick click-based backup, or use command-line tools if you prefer working with text commands. Both methods ensure you can quickly restore your network security rules if your computer encounters an issue.

  • Windows Security App: Use the Export and Import Policy buttons. This is easier for most people.
  • Command Prompt or PowerShell: Use special commands to back up and restore your settings. This method requires administrator privileges.

Backing up Microsoft Defender Firewall settings allows users to quickly restore the firewall configuration if issues arise. This backup process also aids in setting up a new computer with pre-configured firewall rules.

⚠️WarningKeeping your Microsoft Defender Firewall backup file in a safe location protects your network security.

Your firewall settings will remain unchanged, ensuring continuous protection. Only you should have access to these backup files.

Was this guide helpful?

Tags: #Windows 11
Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

📚 Related Tutorials

How to Turn On or off Microsoft Defender Firewall in Windows 11
Windows How to Turn On or off Microsoft Defender Firewall in Windows 11
How to Open Windows Terminal as Admin Automatically
Windows How to Open Windows Terminal as Admin Automatically
How to Access Settings in Windows 11
Windows How to Access Settings in Windows 11
How to Restore Windows Firewall Settings to Default
Windows How to Restore Windows Firewall Settings to Default

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *