Windows Firewall
Cheat sheet · https://pcornel.dk/topic.php?topic=3098
Answer
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.
Remember
- 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.
First checks
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
Commands
netsh advfirewall- Configure Windows Firewall from the command line.
New-NetFirewallRule- Create a Windows Firewall rule.
Get-NetFirewallRule- Firewall rules and policy metadata.
Get-NetFirewallRule [-DisplayName <pattern>]- Display Windows Firewall rules.
Get-NetFirewallRule | Where-Object Enabled -eq True- Shows enabled Windows Defender Firewall rules.
Verify in this order
active profile → rules → default action → packet allowed/blocked
Where it usually breaks
First mismatch in host/interface identity → local config/routing/name state → Windows service/provider → firewall/security/session → remote service → application-visible exchange; preserve identity/native error/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3098