Skip to content

Knowledgebase

Creating a narrowly scoped Windows Firewall rule

servers, security-ssl

Create a Windows Firewall rule for the specific service, port and remote sources that need access. Confirm the application is listening first: a firewall exception does not start a stopped service or configure its network binding.

01 Define the intended traffic

Record the direction, TCP or UDP protocol, local port, applicable network profile and permitted source addresses. Identify the application executable when a program-specific restriction is suitable. Also check whether Group Policy or another management system owns the rule.

Keep an approved management session and console recovery route available when changing rules that could affect your own access. Review existing rules because a broader allowance may remain effective even after you create a narrower one.

02 Create an inbound rule

  1. Open wf.msc with the required administrative permissions. In Windows Defender Firewall with Advanced Security, choose Inbound Rules and New Rule.
  2. Select Custom to expose the full set of controls.
  3. On the Program page, choose the verified program path if the rule should be tied to that executable. Otherwise, use the appropriate port-based design and understand that it can allow another process listening on that port.
  4. Select the correct protocol and enter only the required local port or range. Do not add both TCP and UDP unless the service needs both.
  5. On Scope, set the permitted remote IP addresses or networks. Use the actual management or application sources, including their IPv6 requirements where relevant.
  6. Choose Allow the connection and select the profiles that match the intended network. Check the active profile rather than assuming a server always uses Domain.
  7. Name the rule clearly and describe its purpose and owner. Save it, then review its properties.

03 Test the result

Test the service from an allowed source and a source that should be denied. Check the provider firewall and any application access control independently. If traffic still fails, inspect the listener, selected profile, effective policy and conflicting rules before expanding the exception.

Common questions

Can I disable Windows Firewall to avoid configuring rules?

Keep the firewall enabled and correct the specific traffic policy. Disabling it removes protections for unrelated services as well.

Why did a local rule stop working after a policy refresh?

A centrally managed policy may control the effective rules or local-rule merging. Change the authoritative policy through its owner instead of repeatedly recreating a local exception.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support