Would you like to learn how to use a group policy to enable and configure the Firewall of a computer running Windows? In this tutorial, we will show you how to enable the Firewall service and create network rules on all computers in the domain using a GPO.
• Windows 2012 R2
• Windows 2016
• Windows 2019
• Windows 10
• Windows 7
Hardware List:
The following section presents the list of equipment used to create this tutorial.
Every piece of hardware listed above can be found at Amazon website.
Windows Related Tutorial:
On this page, we offer quick access to a list of tutorials related to Windows.
Tutorial GPO – Configure the Windows firewall
On the domain controller, open the group policy management tool.

Create a new group policy.

Enter a name for the new group policy.

In our example, the new GPO was named: MY-GPO.
On the Group Policy Management screen, expand the folder named Group Policy Objects.
Right-click your new Group Policy Object and select the Edit option.

On the group policy editor screen, expand the Computer configuration folder and locate the following item.
Select the option named Windows Firewall with Advanced Security

Access the option named Windows firewall properties.

Select the desired network profile and perform the following configuration:
• Firewall state – On.
• Inbound connections – Block.
• Outbound connections – Allow.
Click on the OK button.

In our example, we are going to enable the Windows firewall when the computer is connected to the Domain network.
In our example, we are going to allow outbound connections.
In our example, we are going to block inbound connections.
The computer will be allowed to start a communication with any device.
Other devices will not be allowed to start communication with the computer.
Optionally, enable the log of blocked packets.

Enable the option named Log dropped packets.

This is the default path for the Windows firewall log.
To save the group policy configuration, you need to close the Group Policy editor.
Congratulations! You have finished the GPO creation.
Tutorial GPO – Create a firewall rule
As an example, we are going to create a white list.
This rule will contain a list of IP addresses that are allowed to start a network connection to the computer.
On the group policy editor, select the option named Windows Firewall with Advanced Security.

Create a new Inbound rule.

Select the Custom option.

Select the All Programs option and click on the Next button.

Click on the Next button.

Enter a list of authorized IP addresses and click on the Next button.
The IP addresses included in the list will be authorized to start communication without restrictions.

Select the option to allow the connection.

Select the desired network profile and click on the Next button.

Enter a name to identify the new inbound rule.

Click on the Finish button.
To save the group policy configuration, you need to close the Group Policy editor.
Congratulations! You have finished the creation of an Inbound rule using a GPO.
Tutorial GPO – Enable the Windows firewall
On the Group policy management screen, you need to right-click the Organizational Unit desired and select the option to link an existent GPO.

In our example, we are going to link the group policy named MY-GPO to the root of the domain.

After applying the GPO you need to wait for 10 or 20 minutes.
During this time the GPO will be replicated to other domain controllers.
In our example, we used a GPO to enable and configure the Windows firewall.