wf.msc: Complete Guide to Windows Defender Firewall with Advanced Security
QUICK ANSWER wf.msc opens Windows Defender Firewall with Advanced Security, an administrative Microsoft Management Console snap-in for managing Windows Firew...
QUICK ANSWER
wf.msc opens Windows Defender Firewall with Advanced Security, an administrative Microsoft Management Console snap-in for managing Windows Firewall. It provides more control than the basic Windows Security interface, including inbound and outbound rules, network profiles, connection security rules, IPsec settings, logging, and active-policy monitoring.
Press Windows + R, enter wf.msc, and press Enter. Administrative rights are required to change settings. Keep the firewall enabled and create narrowly scoped rules only for trusted applications, services, ports, and remote addresses.
What Is wf.msc?
wf.msc is the console file used to open Windows Defender Firewall with Advanced Security, commonly abbreviated as WFAS. It is an MMC snap-in included with supported Windows client and Windows Server versions.
WFAS manages the same underlying Windows Firewall as the Windows Security app and Control Panel, but it exposes considerably more configuration detail. Microsoft identifies it as the advanced local and Group Policy management interface for Windows Firewall.
It can be used to:
-
Review the firewall status for each network profile.
-
Create inbound and outbound traffic rules.
-
Allow or block programs, services, ports, protocols, and IP addresses.
-
Configure authenticated or protected connections with IPsec.
-
Review currently active rules and security associations.
-
Configure notifications and firewall logging.
-
Import or export firewall policy.
-
Manage local policy or firewall settings delivered through Group Policy.
wf.msc configures the firewall; it is not the firewall engine itself.
How to Open wf.msc
Using the Run dialog
-
Press
Windows + R. -
Enter:
wf.msc
-
Press Enter.
-
Approve the User Account Control prompt if one appears.
You can also search for Windows Defender Firewall with Advanced Security from Start.
Administrator requirement
A standard user may be able to view parts of the console, but administrative rights are required to change the local firewall configuration. Managing a domain Group Policy Object requires appropriate delegated permissions, such as permission to edit that GPO.
Other Windows Firewall interfaces
| Interface | Best use |
|---|---|
| Windows Security | Checking firewall status and basic network protection |
firewall.cpl |
Allowing apps and performing basic configuration |
wf.msc |
Detailed rules, profiles, IPsec, monitoring, and logging |
| PowerShell NetSecurity module | Automation, reporting, and repeatable administration |
| Group Policy | Centrally managing Active Directory domain devices |
| Firewall CSP or Microsoft Intune | Managing supported devices through MDM |
All these interfaces work with the same underlying Windows Firewall services, although they expose different levels of control.
How Windows Firewall Works
Windows Firewall is a stateful, host-based firewall. It evaluates network traffic at the individual Windows device and applies filters through the Windows Filtering Platform.
By default, Windows Firewall generally:
-
Blocks unsolicited inbound traffic unless it is a response to traffic initiated by the computer or matches an allow rule.
-
Allows outbound traffic unless it matches a block rule.
Rules can evaluate conditions including the program or service, protocol, local and remote ports, source and destination addresses, interface type, network profile, and ICMP type.
Stateful traffic handling
When an application initiates an allowed outbound connection, Windows Firewall tracks that connection. Reply traffic belonging to the established connection is normally allowed without requiring a separate inbound rule.
An inbound rule is generally needed when another device must initiate a new connection to a service listening on the Windows computer.
Firewall rule precedence
Windows Firewall does not use a simple top-to-bottom rule order. Important precedence behavior includes:
-
An explicit allow rule can override the profile’s default block action.
-
An explicit block rule overrides a conflicting allow rule.
-
More specific matching rules generally take precedence over less specific rules, except that an explicit block still wins.
-
Administrators cannot assign numerical weights to control rule order.
A connection can therefore remain blocked even when an apparent allow rule exists if another explicit block rule also matches it.
Understanding Firewall Profiles
Windows Firewall maintains separate configurations for three network profiles.
| Profile | Intended use |
|---|---|
| Domain | Applied when an Active Directory domain-joined device can authenticate to its domain |
| Private | Trusted networks, such as a controlled home or business network |
| Public | Untrusted networks, such as airports, hotels, and public Wi-Fi |
The Public profile is designed to be more restrictive and is the default for unidentified networks. The Domain profile is selected automatically when Windows detects and authenticates with the domain; users cannot simply select it manually.
To check the active network category in PowerShell, run:
Get-NetConnectionProfile
Do not change an untrusted network to Private merely to make an application work. Correct the application’s firewall rule and limit it to the necessary profile instead.
Main Sections of the wf.msc Console
Inbound Rules
Inbound rules control connections initiated by another device toward the local computer.
Common examples include:
-
File and printer sharing.
-
Remote administration.
-
Web or database servers.
-
Network discovery.
-
Applications that accept client connections.
An inbound rule should identify the smallest practical combination of program, service, protocol, port, profile, and remote address.
Outbound Rules
Outbound rules control connections initiated by applications or services on the local computer.
Windows permits outbound traffic by default unless a block rule applies. Organizations with strict security or compliance requirements may implement outbound restrictions, but doing so requires careful planning because Windows, business applications, updates, name resolution, authentication, and management tools may depend on outbound connectivity.
Connection Security Rules
Connection Security Rules configure IPsec authentication and, where selected, data integrity or encryption between compatible endpoints.
These rules can be used for:
-
Server or domain isolation.
-
Authenticated communication between managed computers.
-
Restricting sensitive services to trusted devices or users.
-
Protecting traffic between endpoints.
A Connection Security Rule does not automatically allow traffic through the firewall. A matching firewall rule may still be required. Both endpoints must also have compatible IPsec authentication and security settings.
Monitoring
The Monitoring section displays the policy currently in effect, including active firewall rules and IPsec security associations.
This is especially useful on managed devices because the effective policy may combine settings from:
-
Local rules.
-
Local security policy.
-
Group Policy.
-
Mobile device management.
-
Application-created rules.
The rule lists under configuration nodes and the effective rules shown under Monitoring may therefore differ.
Creating a Safe Inbound Rule
Before creating a rule, confirm:
-
Which executable or Windows service requires access.
-
Whether it uses TCP, UDP, ICMP, or another protocol.
-
The exact local port or ports.
-
Which remote devices need access.
-
Which network profiles require the rule.
-
Whether the application installer already created a suitable rule.
To create a rule:
-
Open
wf.msc. -
Select Inbound Rules.
-
Select New Rule in the Actions pane.
-
Choose a rule type:
-
Program for a specific executable.
-
Port for TCP or UDP ports.
-
Predefined for supported Windows features.
-
Custom for complete control over programs, services, ports, addresses, and interfaces.
-
-
Configure the required conditions.
-
Choose Allow the connection, Allow the connection if it is secure, or Block the connection.
-
Select only the necessary profiles.
-
Give the rule a descriptive name.
-
Test the application from an authorized remote device.
Microsoft recommends the Custom rule type when full control over the rule’s scope is needed.
Program rule or port rule?
A program rule is usually safer when only one application should receive the traffic. A broad port rule can permit any program listening on that port unless other rule conditions restrict it.
Application rules must use the executable’s full path; wildcard executable paths such as C:\*\app.exe are not supported.
Example: restricted web-service rule
If an approved service listens on TCP port 8443 and should be reached only from 192.168.10.0/24:
-
Create a Custom inbound rule.
-
Select TCP.
-
Set the local port to
8443. -
Set the remote IP scope to
192.168.10.0/24. -
Select Allow the connection.
-
Apply only the required profile.
-
Name it clearly, such as
Allow AppName TCP 8443 from Management LAN.
Replace the example values with the application vendor’s documented requirements. Never open a port merely because a generic troubleshooting page recommends it.
Creating and Managing Rules with PowerShell
Run PowerShell as an administrator.
Check firewall profile status
Get-NetFirewallProfile |
Select-Object Name, Enabled, DefaultInboundAction, DefaultOutboundAction
List enabled inbound rules
Get-NetFirewallRule -Direction Inbound -Enabled True |
Select-Object DisplayName, Action, Profile
Create a restricted inbound port rule
New-NetFirewallRule `
-DisplayName "Allow AppName TCP 8443 from Management LAN" `
-Direction Inbound `
-Action Allow `
-Protocol TCP `
-LocalPort 8443 `
-RemoteAddress 192.168.10.0/24 `
-Profile Domain,Private
Disable or remove the example rule
Disable it while retaining the configuration:
Disable-NetFirewallRule -DisplayName "Allow AppName TCP 8443 from Management LAN"
Remove it permanently:
Remove-NetFirewallRule -DisplayName "Allow AppName TCP 8443 from Management LAN"
Use a unique rule name and inspect matching rules before changing or removing them.
Ensure all profiles are enabled
Set-NetFirewallProfile -Profile Domain,Private,Public -Enabled True
Microsoft documents both PowerShell and netsh advfirewall for administration, but PowerShell is generally more suitable for modern automation and structured output.
Firewall Logging
Firewall logging can record dropped packets, successful connections, or both. It is useful when a rule appears ineffective or an application cannot communicate.
To configure logging in wf.msc:
-
Select Windows Defender Firewall with Advanced Security on Local Computer.
-
Select Properties.
-
Open the Domain, Private, or Public Profile tab.
-
Under Logging, select Customize.
-
Enable Log dropped packets.
-
Enable Log successful connections when required.
-
Review the log path and maximum size.
-
Select OK.
The default log location is:
%windir%\System32\LogFiles\Firewall\pfirewall.log
No traffic is logged until dropped packets or successful connections are enabled. The firewall service must have write permission to the selected location. Microsoft recommends separate files for each profile and a larger log size in managed environments to reduce premature rotation.
Logging successful connections on a busy device can generate substantial data. Enable it according to operational, storage, privacy, and retention requirements.
Local Rules, Group Policy, and MDM
A rule created in the local wf.msc console might not determine the final result on an organization-managed device.
Administrators can control whether local rules merge with rules delivered through Group Policy or MDM. If local policy merging is disabled, a locally created allow rule may appear in the console but not become part of the effective policy. Review the Monitoring section and your organization’s management policy before troubleshooting locally.
For Active Directory devices, firewall policy is available under:
Computer Configuration
└─ Policies
└─ Windows Settings
└─ Security Settings
└─ Windows Firewall with Advanced Security
For larger or cloud-managed environments, use Group Policy, Microsoft Intune, or another supported MDM solution rather than configuring devices individually.
Benefits of wf.msc
Granular access control
Rules can be limited to particular executables, services, protocols, ports, addresses, interfaces, and network profiles. This is safer than broadly enabling an application or disabling the firewall.
Built-in host protection
Windows Firewall is included with Windows and protects a device even when it is outside the organization’s perimeter firewall. It complements, rather than replaces, network firewalls and other security controls.
Centralized enterprise management
The same firewall technology can be administered locally, through Active Directory Group Policy, or through supported MDM policies.
IPsec integration
WFAS combines packet filtering with IPsec connection security, enabling authenticated, integrity-protected, or encrypted device-to-device communication where properly configured.
Troubleshooting and visibility
Monitoring, logging, effective-policy views, and PowerShell reporting help administrators determine why traffic is allowed or blocked.
Profile-aware rules
A rule can be enabled for a trusted Domain or Private network without exposing the same service on a Public network.
Automation support
The NetSecurity PowerShell module enables repeatable deployment, auditing, and reporting without manually configuring every endpoint.
Security Risks and Best Practices
Do not disable the firewall to fix an application
Disabling the firewall removes an important security boundary. Identify the required traffic and create a narrow exception instead.
Microsoft specifically advises against stopping the Windows Defender Firewall service, whose service name is MpsSvc. Stopping it is unsupported and can cause Windows features and applications to malfunction. If temporary profile disabling is genuinely required for controlled testing, leave the service running, limit the duration, and restore protection immediately.
Apply least privilege to every rule
Where possible:
-
Prefer a program or service-specific rule.
-
Restrict remote IP addresses.
-
Select only the necessary profile.
-
Specify the exact protocol and ports.
-
Avoid Any program, Any port, and Any remote address together.
-
Document the owner and purpose in the rule description.
-
Disable or remove obsolete rules.
-
Test changes before broad deployment.
Treat Public networks as untrusted
Avoid enabling server, discovery, remote-management, or file-sharing rules on the Public profile unless there is a documented requirement and appropriate additional protection.
Verify the process before opening a port
Use the application’s official documentation and confirm which process owns the listening port. One useful command is:
Get-NetTCPConnection -State Listen |
Sort-Object LocalPort |
Select-Object LocalAddress, LocalPort, OwningProcess
To identify a process from its PID:
Get-Process -Id <PID>
Replace <PID> with the numeric process ID returned by the first command.
Back up policy before major changes
In wf.msc, use Action > Export Policy to save the current policy before extensive local modifications. Importing a policy replaces the applicable existing local firewall policy, so validate the file and understand its scope before importing it.
Troubleshooting wf.msc and Firewall Rules
wf.msc does not open
Confirm that the command is entered exactly as:
wf.msc
If Windows reports that MMC cannot open the file:
-
Restart Windows.
-
Install pending supported Windows updates.
-
Open an elevated Command Prompt and run:
sfc /scannow
-
If corruption is reported but not repaired, use Microsoft-supported Windows image repair procedures.
-
Check whether organizational policy restricts MMC snap-ins.
Do not download a replacement wf.msc file from an unofficial website.
A rule exists, but the connection is still blocked
Check the following:
-
The rule is enabled.
-
Its direction is correct.
-
The active network profile matches the rule.
-
The executable path, protocol, and ports are correct.
-
The local and remote address scopes match the connection.
-
No explicit block rule also matches.
-
The application is listening on the expected local address and port.
-
A centrally managed policy is not overriding or excluding the local rule.
-
A third-party firewall, network firewall, router, VPN, or cloud security group is not blocking the traffic.
Useful commands include:
Get-NetConnectionProfile
Get-NetFirewallProfile
Get-NetFirewallRule -PolicyStore ActiveStore
The port rule works, but the application does not
The firewall only permits or blocks traffic; it does not start the application or make it listen on a port. Verify that the service is running, bound to the expected interface, and configured for the correct protocol and port.
Internet access fails after changing outbound rules
Disable only the newly created rule and retest:
Disable-NetFirewallRule -DisplayName "Exact rule name"
Outbound allow-listing can affect DNS, DHCP, authentication, updates, VPN software, security agents, and application dependencies. Deploy it only after testing and documenting required destinations and services.
The firewall log is empty
Verify that:
-
Logging is enabled for the active profile.
-
At least one of the logging options is set to Yes.
-
The Windows Firewall service can write to the log directory.
-
You are reading the configured file rather than assuming the default location.
-
The tested traffic actually passes through the relevant profile and rule path.
FAQ
Frequently Asked Questions
Is wf.msc safe to use?
Yes. It is a built-in Microsoft administrative console. However, incorrect rules can expose services or interrupt network access, so changes should be limited, documented, and tested.
Does wf.msc work on Windows 10 and Windows 11?
Yes. Microsoft documents Windows Firewall with Advanced Security and its associated management tools for supported Windows 10, Windows 11, and Windows Server releases. Available management options can vary by Windows edition and organizational policy.
What is the difference between wf.msc and firewall.cpl?
firewall.cpl provides basic Control Panel options. wf.msc provides advanced inbound and outbound rules, profiles, connection security rules, monitoring, and detailed logging configuration.
Does an inbound rule open a port on my router?
No. A Windows Firewall rule affects only the Windows device. Internet-originated access may additionally require router, NAT, VPN, cloud firewall, or network-security configuration. Exposing a device directly to the internet is usually riskier than using a properly secured VPN or managed remote-access solution.
Why does Windows Firewall allow outbound traffic by default?
The default policy is designed to block unsolicited inbound connections while allowing locally initiated activity. Administrators can restrict outbound traffic, but a secure outbound allow-list requires careful dependency analysis and ongoing maintenance.
Can I create firewall rules without administrator rights?
You generally need administrative rights to change local Windows Firewall configuration. Domain, Intune, or other managed policies require separate authorized administrative permissions.
Should I create a program rule or a port rule?
Prefer a program or service-specific rule when one known application needs access. Use a port rule when multiple approved applications legitimately require the same port or when the service cannot be reliably scoped by executable. Add address and profile restrictions in either case.
What is the difference between a firewall rule and a Connection Security Rule?
A firewall rule allows or blocks matching traffic. A Connection Security Rule negotiates IPsec authentication and optional protection. IPsec negotiation does not automatically allow traffic; both rule types may be needed.
Can Group Policy override rules created in wf.msc?
Yes. Centrally managed policy can control firewall settings and whether locally created rules are merged into the effective policy. Use the Monitoring section or query the active policy store to verify what is actually enforced.
FINAL RECOMMENDATION / CONCLUSION
Use wf.msc when the basic Windows Firewall interface does not provide enough control. Keep all required firewall profiles enabled, create the narrowest possible rules, restrict access by program, port, profile, and remote address, and verify the effective policy after every significant change.
For business environments, test rules on a limited group before deploying them through Group Policy or MDM. Enable appropriate logging, document each exception, review rules periodically, and never use permanent firewall disabling as an application troubleshooting shortcut.
#wfmsc #WindowsFirewall #WindowsDefenderFirewall #WFAS #Windows11 #Windows10 #WindowsServer #FirewallRules #InboundRules #OutboundRules #FirewallProfiles #NetworkSecurity #WindowsSecurity #IPsec #PowerShell #GroupPolicy #FirewallLogging #ITAdministration #Cybersecurity #Troubleshooting
SOURCES
-
Microsoft Learn — Windows Firewall overview.
-
Microsoft Learn — Windows Firewall tools.
-
Microsoft Learn — Windows Firewall rules.
-
Microsoft Learn — Configure firewall rules with Group Policy.
-
Microsoft Learn — Configure Windows Firewall logging.
-
Microsoft Learn — Manage Windows Firewall with the command line.
Was this guide useful?
Your answer helps us keep BISONKB accurate and practical.