How to Backup and Restore Firewall Rules in Windows 10

In Windows 10, you can configure Windows Firewall to have custom rules for a specific address, port or protocol. You can allow or block an app from accessing the Internet. Once you do this, it is a good idea to backup your Firewall configuration. In this article, we will see how it can be done.


Having a backup of firewall rules is very useful. If you reinstall Windows 10, you will be able to restore your custom rules quickly. Or, if you need to reset the Windows Firewall configuration, then having the ability to restore the custom configuration is very time saving.

Before you continue, see how to block any app from accessing Internet with one click in Windows 10, Windows 8 and Windows 7.

How to Backup and Restore Firewall Rules in Windows 10
In Windows 10, there are several ways to create a backup of Firewall rules. You can use Windows Firewall with Advanced Security snap-in to create or restore rules, or you can do it with the built-in console command netsh. Let's see how it can be done.

The Windows Firewall with Advanced Security tool provides the nice and easy to use GUI to export and import rules.

Backup and Restore Firewall Rules in Windows 10 using Windows Firewall with Advanced Security

  1. Open Settings app.
  2. Go to Network & internet - Status:
  3. Scroll down in the right pane until you see the link "Windows Firewall". Click it.
  4. The basic Windows Firewall configuration will be opened. On the left, click the link "Advanced settings":
  5. Windows Firewall with Advanced Security will be opened. It looks as follows:

    Right click the root element in the left pane named Windows Firewall with Advanced Security on Local Computer:
  6. In the context menu, select the item "Export Policy":
  7. Once you click it, you will be prompted to enter the destination file where the rules will be saved. A special file with the *.WFW extension will be created. So, you need to select a folder where the file will be stored and enter its name.

Congrats, you created a backup copy of Windows Firewall rules. The app will confirm the operation with the following dialog box:

In the same way, you can restore rules from a backup you created earlier.

Tip: You can quickly open Windows Firewall with Advanced Security from the Run dialog.

  1. Press Win + R shortcut keys together on the keyboard to open the Run dialog. See the ultimate list of all Windows keyboard shortcuts with Win keys.
  2. Type the following in the Run box:
    wf.msc

    This will open Windows Firewall with Advanced Security directly.

  3. There, right click the root element in the left pane named Windows Firewall with Advanced Security on Local Computer:
  4. In the context menu, select the item "Import Policy":
  5. A confirmation dialog will appear on the screen. It warns that importing a policy will overwrite all of the current Windows Firewall with Advanced Security policy. You need to click Yes to continue.
  6. Browse for the *.WFW file you created earlier to restore it:
  7. Windows will show the following dialog box once the rules are restored:

If you prefer the command line, you can backup or restore Windows Firewall rules using the console tool netsh. Here is how.

Backup and Restore Firewall Rules in Windows 10 using Netsh

  1. Open a new elevated command prompt instance.
  2. The syntax for the command looks as follows:
    netsh advfirewall export "path\to\file.wfw"

    For example, I will use the command

    netsh advfirewall export "c:\winaero\firewall_rules_backup.wfw"

    Change the file path portion according to your preferences.

  3. Once you execute the command, it will produce the following output:

To restore Windows Firewall rules with netsh.

  1. Open a new elevated command prompt instance.
  2. The syntax for the command looks as follows:
    netsh advfirewall import "path\to\file.wfw"

    I will use the same file to restore the exported rules.

    netsh advfirewall import "c:\winaero\firewall_rules_backup.wfw"

    Again, you should change the file path portion according to your preferences.

  3. The command will produce the following output:

Files exported and imported using either method are compatible. This means that you can export your rules using the GUI and restore them using netsh and vice versa. It is very useful if you want to automate your Firewall rules backup and restore process.

That's it.

Leave a Reply

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