Jump to content

How to Backup and Restore Firewall Rules in Windows 10


Jordan

Recommended Posts

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

 

Open Settings app.

 

Settings-app-600x474.png

 

Go to Network & internet - Status:


settings-network-and-internet-status-600

 

Scroll down in the right pane until you see the link "Windows Firewall". Click it.


open-windows-firewall-link-600x470.png

 

The basic Windows Firewall configuration will be opened. On the left, click the link "Advanced settings":


Windows-10-Firewal-basic-configuration-6

 

Windows Firewall with Advanced Security will be opened. It looks as follows:


Windows-10-Firewal-advanced-configuratio


Right click the root element in the left pane named Windows Firewall with Advanced Security on Local Computer:

 

Windows-10-Firewal-advanced-configuratio

 

In the context menu, select the item "Export Policy":


backup-firewall-rules-600x386.png

 

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.

 

Windows-10-Backup-Firewall-Rules-600x386

 

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


Windows-10-Firewall-Rules-exported.png

 

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.

 

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.

Type the following in the Run box:

wf.msc

This will open Windows Firewall with Advanced Security directly.

 

run-dialog-wf-msc.png

 

There, right click the root element in the left pane named Windows Firewall with Advanced Security on Local Computer:

 

Windows-10-Firewal-advanced-configuratio

 

In the context menu, select the item "Import Policy":


Windows-Restore-Firewall-Rules-600x386.p

 

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.


Restore-rules-confirmation.png

 

Browse for the *.WFW file you created earlier to restore it:

 

browse-for-rules-dialog-600x386.png

 

Windows will show the following dialog box once the rules are restored:


rules-restored-confirmation.png

 

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

Open a new elevated command prompt instance.

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.

 

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

 

netsh-backup-firewall-rules-600x314.png

 

To restore Windows Firewall rules with netsh.

Open a new elevated command prompt instance.

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.

 

The command will produce the following output:

 

netsh-restore-firewall-rules-600x314.png

 

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.

 

SOURCE

Link to comment
Share on other sites


  • Views 1.4k
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...