Use this when traffic to or from a Windows machine is blocked or must be controlled.
Windows Firewall
Windows Defender Firewall is the built-in host firewall. It filters inbound and outbound traffic with rules per profile (Domain, Private, Public) and is managed via wf.msc, netsh advfirewall, PowerShell or GPO.
1. Get-NetFirewallProfile — enabled, default inbound Block?
2. Active profile: Get-NetConnectionProfile.
3. Rule for the service in that profile?
4. Logging for drops.
5. Test from another host.
active profile → rules → default action → packet allowed/blocked
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Get-NetFirewallRulePrimary Commands
Configuration and operational commands for this Topic.
Get-NetFirewallRuleVerifyFirewall rules and policy metadata.
Use when: Use after confirming the PowerShell target and before changing state.
Quick note: Windows / Windows Server / PowerShell. A running Windows service or successful cmdlet does not prove effective policy, replication, authorization or remote consumer success.
Windows PowerShell · mixedGet-NetFirewallRule [-DisplayName <pattern>]ReferenceDisplay Windows Firewall rules.
Use when: Use after confirming the PowerShell target and before changing state.
Quick note: Windows / Windows Server / PowerShell. A running Windows service or successful cmdlet does not prove effective policy, replication, authorization or remote consumer success.
Windows PowerShell · mixedGet-NetFirewallRule | Where-Object Enabled -eq TrueVerifyShows enabled Windows Defender Firewall rules.
Use when: Use after confirming the PowerShell target and before changing state.
Quick note: Windows / Windows Server / PowerShell. A running Windows service or successful cmdlet does not prove effective policy, replication, authorization or remote consumer success.
Windows PowerShell · mixednetsh advfirewallReferenceConfigure Windows Firewall from the command line.
Windows / Windows Server / PowerShell · mixedNew-NetFirewallRuleConfigureCreate a Windows Firewall rule.
Windows / Windows Server / PowerShell · mixedVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Allow rule created for the wrong profile.
- Local rules ignored because GPO turns off local rule merging.
Subtopics
Go one level deeper into this subject.
Windows Defender Firewall is the stateful host firewall in Windows.
Subtopic Firewall ProfilesWindows Firewall has three profiles — Domain, Private and Public — chosen by Network Location Awareness for each network.
Subtopic Inbound RulesInbound rules allow or block traffic coming into the computer by program, port, protocol, address, profile and interface.
Subtopic Outbound RulesOutbound rules control traffic leaving the computer. The default allows all outbound traffic, but blocking rules or a default-block policy can restrict which programs may connect out.
Subtopic Connection Security RulesConnection security rules in Windows Firewall use IPsec to authenticate and optionally encrypt traffic between computers, such as requiring Kerberos-authenticated connections to servers or domain isolation.
Subtopic Windows Filtering PlatformThe Windows Filtering Platform (WFP) is the kernel framework under Windows Firewall, IPsec and third-party security products.
Subtopic Firewall TroubleshootingTroubleshoot Windows Firewall by checking the active profile, testing with Test-NetConnection, reviewing rules with Get-NetFirewallRule, enabling firewall logging (pfirewall.log) and checking GPO-applied rules.
- The default inbound action is block; outbound is allow.
- The active profile (Domain, Private, Public) decides which rules apply.
- GPO firewall rules merge with or override local rules.
Get-NetFirewallProfile— profiles, enabled, default actions, loggingGet-NetFirewallRule -Enabled True -Direction Inbound— enabled inbound rulesGet-NetFirewallRule -DisplayName '<name>' | Get-NetFirewallPortFilter— ports of a rulenetsh advfirewall monitor show firewall— effective state
ReferenceWhy it matters1 section · depth on demand
How it works
Windows Defender Firewall is a stateful host firewall built on the Windows Filtering Platform. It applies one profile per network (Domain, Private, Public). By default inbound traffic is blocked unless a rule allows it, and outbound traffic is allowed. Replies to allowed outbound connections are permitted automatically. Rules can match program, service, port, protocol, address and profile; GPO rules merge with local rules unless local merging is disabled.
ReferenceImportant terms & boundaries1 section · depth on demand
Commands
Get-NetFirewallProfile | Select Name,Enabled,DefaultInboundAction,DefaultOutboundAction
Get-NetFirewallRule -Enabled True -Direction Inbound | Select DisplayName,Profile,Action
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Windows Firewall. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/ · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.