Windows Firewall

IZAAN JAMSHAID AWAN 1 Reputation point
2022-06-21T11:30:30.757+00:00

Hi, I am trying to use a firewall utility but it is not functioning properly. I have tried this documentation https://learn.microsoft.com/en-us/powershell/module/netsecurity/set-netfirewallprofile?view=windowsserver2019-ps

set-netfirewallprofile -all -DefaultInboundAction Block (Block: Blocks inbound network traffic that does not match an inbound rule.)
set-netfirewallprofile -all -DefaultOutboundAction Block (Block: Blocks outbound network traffic that does not match an outbound rule.)

I have used the above commands to block all inbound and outbound traffic in windows. As per documentation, the above commands action "BLOCK" is used to block all traffic except the rules of firewall that allow the traffic to pass. But in my case, the traffic allowed in the rules are also being blocked by the these rules. My rules are working with ports like 443, 25000 etc.

Kindly help me sort out this problem. If i am doing it wrong then kindly point me in the right direction. Thanks

Windows for business Windows Client for IT Pros Devices and deployment Configure application groups
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,916 Reputation points
    2022-06-23T09:05:30.247+00:00

    Hi there,

    Before running this Powershell command make sure you have created the Outbound & Inbound Port Rule.

    By default, Windows Defender Firewall allows all outbound network traffic unless it matches a rule that prohibits the traffic. By default, Windows Defender Firewall block all inbound network traffic unless it matches a rule that allow the traffic.

    Windows Firewall - Block all traffic by default unless traffic matches explicitly defined rules https://learn.microsoft.com/en-us/answers/questions/47481/windows-firewall-block-all-traffic-by-default-unle.html

    Create an Outbound Port Rule https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-firewall/create-an-outbound-port-rule Turn on Windows Defender Firewall with Advanced Security and Configure Default Behavior

    https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-firewall/turn-on-windows-firewall-and-configure-default-behavior Hope this resolves your Query !!

    ------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept it as an answer–

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.