On Windows 10, the Windows Defender Firewall is a security feature that checks incoming and outgoing network traffic and allows or blocks specific traffic depending on predefined rules.
Although every installation of Windows 10 comes with the same set of default rules, you can always create new custom rules to allow or block apps from accessing the network. If you have created multiple firewall rules, and you don’t want to lose you settings after a clean installation, or you want configure other devices with the same policy, you can export and import the Windows Defender Firewall rules using the advanced settings console and Command Prompt.
In this guide, you’ll learn the steps to export the current list of firewall rules as well as the steps to import the rules to a new installation of Windows 10.
- How to export and import firewall rules using Windows Security
- How to export and import firewall rules using Command Prompt
How to export and import firewall rules using Windows Security
If you want to backup all the Windows 10 firewall rules, so you can then restore to another installation, you can use the Windows Security app.
Backing up firewall rules
To export firewall rules using Windows Security, use these steps:
-
Open Windows Security.
-
Click on Firewall & network protection.
-
Click the Advanced settings option.
-
Right-click the Windows Defender Firewall with Advanced Security on Local Computer item and select the Export Policy option.
-
Select a location to store the list.
-
Type a descriptive name for the list – for example, firewall-rules.
-
Click the Save button.
-
Click the OK button.
Once you complete the steps, the firewall rules will export in the wfw file that you can easily import to the same or different computer.
Restoring firewall rules
To import firewall rules from an exported file, use these steps:
-
Open Windows Security.
-
Click on Firewall & network protection.
-
Click the Advanced settings option.
-
Right-click the Windows Defender Firewall with Advanced Security on Local Computer item and select the Import Policy option.
-
Click the Yes button to confirm that importing a policy will overwrite all the current rules.
-
Select the .wfw file.
-
Click the Open button.
-
Click the OK button.
After you complete the steps, the policy will overwrite the current rules with the ones in the .wfw file.
How to export and import firewall rules using Command Prompt
Alternatively, you can also export and import firewall rules on Windows 10 using Command Prompt.
Exporting firewall rules
To export the current firewall policy using Command Prompt, use these steps:
-
Open Start.
-
Search for Command Prompt, right-click the top result, and select the Run as administrator option.
-
Type the following command to export the Windows Defender Firewall rules and press Enter:
netsh advfirewall export "C:\firewall-rules.wfw"
Once you complete the steps, all the firewall rules will be exported to a .wfw, which you can then import on another installation of Windows 10.
Importing firewall rules
To import firewall rules on Windows 10 with Command Prompt, use these steps:
-
Open Start.
-
Search for Command Prompt, right-click the top result, and select the Run as administrator option.
-
Type the following command to export the Windows Defender Firewall rules and press Enter:
netsh advfirewall import "C:\firewall-rules.wfw"
After you complete the steps, the firewall rules will import overwriting the device current policy settings.
We’re using Command Prompt, but you can also use the commands on PowerShell.