How to Configure Windows Defender Firewall in Windows Server 2022

Posted on 19th June 2023

Introduction

Windows Defender Firewall is a stateful host-based firewall that provides inbound and outbound filtering and uses the Security Filtering feature in Windows Firewall with Advanced Security to filter network traffic. It is included with Windows Server 2020 and higher and can be enabled through either the Windows Defender Firewall with Advanced Security MMC snap-in or through Group Policy. In this article, we will show you how to configure Windows Defender Firewall in Windows Server 2022.

Prerequisites

To follow this article, you will need the following:

  • A server running Windows Server 2022
  • Administrator privileges on the server

Enabling Windows Defender Firewall

Before you can configure Windows Defender Firewall, you need to enable it. You can do this through the Windows Defender Firewall with Advanced Security MMC snap-in or through Group Policy. We will show you both methods.

Enabling Windows Defender Firewall through the MMC snap-in

To enable Windows Defender Firewall through the MMC snap-in, follow these steps:

  1. Open the Windows Defender Firewall with Advanced Security MMC snap-in.
  2. In the left pane, click on the Windows Defender Firewall node.
  3. In the right pane, click on the Enable Firewall button.
  4. A dialog box will appear. Click on the Yes button to confirm that you want to enable the firewall.

Enabling Windows Defender Firewall through Group Policy

To enable Windows Defender Firewall through Group Policy, follow these steps:

  1. Open the Group Policy Management Console.
  2. Create or edit a Group Policy object.
  3. Navigate to the following setting: Computer Configuration > Policies > Administrative Templates > Network > Network Connections > Windows Firewall > Domain Profile > Protect all network connections.
  4. Enable the policy and click on the Ok button.

Configuring Windows Defender Firewall

Once you have enabled Windows Defender Firewall, you can configure it to suit your needs. We will show you how to configure it through the Windows Defender Firewall with Advanced Security MMC snap-in and through Group Policy.

Configuring Windows Defender Firewall through the MMC snap-in

To configure Windows Defender Firewall through the MMC snap-in, follow these steps:

  1. Open the Windows Defender Firewall with Advanced Security MMC snap-in.
  2. In the left pane, click on the Inbound Rules node.
  3. In the right pane, click on the New Rule button.
  4. A wizard will appear. Click on the Custom rule type and click on the Next button.
  5. On the Protocol and Ports page, select the All programs option and click on the Next button.
  6. On the Scope page, select the Anywhere option and click on the Next button.
  7. On the Action page, select the Allow the connection option and click on the Next button.
  8. On the Profile page, select the Domain, Private, and Public options and click on the Next button.
  9. On the Name page, enter a name for the rule and click on the Finish button.

Configuring Windows Defender Firewall through Group Policy

To configure Windows Defender Firewall through Group Policy, follow these steps:

  1. Open the Group Policy Management Console.
  2. Create or edit a Group Policy object.
  3. Navigate to the following setting: Computer Configuration > Policies > Administrative Templates > Network > Network Connections > Windows Firewall > Domain Profile > Inbound connections.
  4. Enable the policy and click on the Ok button.

Conclusion

In this article, we have shown you how to configure Windows Defender Firewall in Windows Server 2022. We have also shown you how to enable and configure it through both the Windows Defender Firewall with Advanced Security MMC snap-in and through Group Policy.

In order to configure Windows Defender Firewall in Windows Server 2022, you will need to open the Server Manager console and navigate to the “Configure Defender Firewall” page. On this page, you will be able to enable or disable the firewall and specify the types of connections that you want to allow or block.

If you want to allow all incoming connections, you can simply check the “Allow all connections” option. However, if you want to be more selective, you can click on the “Advanced” button and configure the firewall to allow or block specific types of connections.

For example, if you want to allow incoming connections from specific IP addresses or domains, you can add them to the “Allowed IP addresses” or “Allowed domains” lists. Alternatively, if you want to block incoming connections from specific IP addresses or domains, you can add them to the “Blocked IP addresses” or “Blocked domains” lists.

If you want to allow or block specific ports, you can add them to the “Allowed ports” or “Blocked ports” lists. Alternatively, if you want to allow or block specific programs, you can add them to the “Allowed programs” or “Blocked programs” lists.

Once you have configured the firewall to your liking, you can click on the “Apply” button to save your changes.

How to Configure Windows Defender Firewall in Windows Server 2022

1. Open the Windows Defender Firewall with Advanced Security console.

2. In the left pane, click on Inbound Rules.

3. On the right pane, click on New Rule.

4. Select Port from the rule type and click Next.

5. Select TCP and enter the port number that you want to allow connections to. Click Next.

6. Select Allow the connection and click Next.

7. Select the profile type that you want to allow connections for and click Next. If you’re not sure, just leave the defaults.

8. Give the rule a name and description. Click Finish.

Now, whenever someone tries to connect to the specified port on your server, the connection will be allowed through the firewall. If you need to allow multiple ports, simply repeat these steps.