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.
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.
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.
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.
- Click the Start button on your taskbar .
- Select Settings from the menu.

- Click Privacy & security on the left side.
- Find the Windows Security tile and click it.

- Click the Open Windows Security button.

- In the Windows Security app, select Firewall & network protection. You can also use this shortcut: Firewall & network protection.

- Scroll down and click the Advanced settings link at the bottom.

To Back Up Your Settings:
- In the window that opens, click Export Policy.
- Choose where you want to save your backup file.
- Give the file a name (it will be a .wfw file).
- Click Save.

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:
- Go back to the Advanced settings window.
- Click Import Policy.
- Find your backup file and open it.
- Your firewall settings will be restored.
Method 2Using Command Prompt or PowerShell
Administrator privileges are required for this method.
- Open the Windows Terminal app as administrator.
- Choose either the Command Prompt or PowerShell tab.
To Back Up Your Settings:
Using Command Prompt:
netsh advfirewall export "%userprofile%\Desktop\FirewallBackup.wfw"Using PowerShell:
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:
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.
Your firewall settings will remain unchanged, ensuring continuous protection. Only you should have access to these backup files.
Was this guide helpful?
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.
No comments yet — be the first to share your thoughts!