Export and Import Firewall Policies in Windows 11
Managing Windows Defender Firewall settings is essential for maintaining consistent network security across multiple devices or backing up configurations before making major system changes. This guide explains how to quickly export and import your complete Windows Defender Firewall configuration policies in Windows 11 using both the graphical interface (Windows Defender Firewall with Advanced Security) and command-line tools.
Method 1: Using Windows Defender Firewall with Advanced Security (GUI)
The graphical interface is the simplest way to create a backup file
(.wfw) and restore it whenever needed.
Exporting Firewall Policies
- Press Windows Key + R to open the Run dialog.
- Type
wf.mscand press Enter to open Windows Defender Firewall with Advanced Security. - In the left navigation pane, right-click on Windows Defender Firewall with Advanced Security on Local Computer (or click Action in the top menu).
- Select Export Policy.
- Choose a secure location on your drive, enter a file name, and click
Save. The configuration will be saved with a
.wfwfile extension.
Importing Firewall Policies
- Open Windows Defender Firewall with Advanced
Security by typing
wf.mscin the Run dialog (Windows Key + R). - Right-click on Windows Defender Firewall with Advanced Security on Local Computer in the left pane (or click Action in the top menu).
- Select Import Policy.
- A warning prompt will appear stating that importing a policy will overwrite all existing firewall rules. Click Yes to proceed.
- Browse to the location of your exported
.wfwfile, select it, and click Open. - A confirmation dialog will appear once the policy is successfully restored. Click OK.
Method 2: Using Command Prompt (CLI)
For administrators or automated scripts, the netsh
utility provides a fast way to export and import firewall rules.
Exporting Firewall Policies via Command Prompt
Press the Windows Key, type
cmd, right-click Command Prompt, and select Run as administrator.Run the following command (replace the file path with your desired destination):
netsh advfirewall export "C:\FirewallBackup.wfw"Press Enter. You will see an Ok. message confirming the export.
Importing Firewall Policies via Command Prompt
Open Command Prompt as an administrator.
Run the following command (replace the file path with your
.wfwfile location):netsh advfirewall import "C:\FirewallBackup.wfw"Press Enter. When the operation completes, an Ok. message will be displayed, indicating that your firewall rules have been restored.