Block Inbound Traffic in Windows Firewall via Regedit

This guide explains how to configure the Windows Defender Firewall to block all incoming network connections by modifying the Windows Registry. You will learn the exact registry paths, key names, and values required to enforce inbound blocking across the Domain, Private (Standard), and Public network profiles.

Step 1: Open the Windows Registry Editor

  1. Press Win + R to open the Run dialog box.
  2. Type regedit and press Enter (or click OK).
  3. Select Yes if prompted by User Account Control (UAC).

Step 2: Navigate to the Firewall Registry Path

In the Registry Editor address bar, navigate to the following path:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy

Under the FirewallPolicy key, you will see subkeys corresponding to the three Windows Firewall profiles:


Step 3: Modify Inbound Traffic Rules

Select the folder of the profile you want to configure (e.g., StandardProfile, DomainProfile, or PublicProfile), then configure the following DWORD (32-bit) values in the right-hand pane:

1. Block Inbound Traffic by Default

(If the value does not exist, right-click an empty area in the right pane, select New > DWORD (32-bit) Value, name it DefaultInboundAction, and set its value to 1.)

2. Block All Inbound Connections (Ignore Exceptions)

To strictly block all incoming traffic, including apps on the allowed list: * Value Name: DoNotAllowExceptions * Type: REG_DWORD * Value Data: 1 (Forces the firewall to block all inbound traffic regardless of existing allow rules)

(If this value does not exist, right-click, select New > DWORD (32-bit) Value, name it DoNotAllowExceptions, and set its value to 1.)


Step 4: Repeat for Other Profiles (Optional)

To apply this behavior globally across all network types, repeat Step 3 for the remaining profile keys under FirewallPolicy: * DomainProfile * StandardProfile * PublicProfile


Step 5: Apply the Changes

Registry changes to the firewall take effect immediately in most cases. To ensure the rules are active without rebooting:

  1. Open Command Prompt as Administrator.

  2. Restart the Windows Firewall service by running:

    net stop mpssvc && net start mpssvc