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

  1. Press Windows Key + R to open the Run dialog.
  2. Type wf.msc and press Enter to open Windows Defender Firewall with Advanced Security.
  3. In the left navigation pane, right-click on Windows Defender Firewall with Advanced Security on Local Computer (or click Action in the top menu).
  4. Select Export Policy.
  5. Choose a secure location on your drive, enter a file name, and click Save. The configuration will be saved with a .wfw file extension.

Importing Firewall Policies

  1. Open Windows Defender Firewall with Advanced Security by typing wf.msc in the Run dialog (Windows Key + R).
  2. Right-click on Windows Defender Firewall with Advanced Security on Local Computer in the left pane (or click Action in the top menu).
  3. Select Import Policy.
  4. A warning prompt will appear stating that importing a policy will overwrite all existing firewall rules. Click Yes to proceed.
  5. Browse to the location of your exported .wfw file, select it, and click Open.
  6. 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

  1. Press the Windows Key, type cmd, right-click Command Prompt, and select Run as administrator.

  2. Run the following command (replace the file path with your desired destination):

    netsh advfirewall export "C:\FirewallBackup.wfw"
  3. Press Enter. You will see an Ok. message confirming the export.

Importing Firewall Policies via Command Prompt

  1. Open Command Prompt as an administrator.

  2. Run the following command (replace the file path with your .wfw file location):

    netsh advfirewall import "C:\FirewallBackup.wfw"
  3. Press Enter. When the operation completes, an Ok. message will be displayed, indicating that your firewall rules have been restored.