How to Configure Ports in Windows 11 Firewall
Configuring Windows Defender Firewall rules allows you to manage network traffic by opening or blocking specific incoming (inbound) and outgoing (outbound) ports on Windows 11. This guide walks you through the step-by-step process of accessing the Advanced Security settings, creating custom rules for TCP or UDP ports, and managing these rules to support applications, hosting servers, or network security needs.
Step 1: Open Windows Defender Firewall with Advanced Security
- Press Windows Key + R to open the Run dialog box.
- Type
wf.mscand press Enter (or click OK). - The Windows Defender Firewall with Advanced Security window will appear.
Step 2: Create an Inbound Rule (Incoming Ports)
Inbound rules control traffic coming into your computer from the local network or the internet.
- In the left navigation pane, click on Inbound Rules.
- In the right Actions pane, click New Rule… to launch the wizard.
- Rule Type: Select Port and click Next.
- Protocol and Ports:
- Choose whether the rule applies to TCP or UDP.
- Select Specific local ports and enter the port
number (e.g.,
80,443, or a range like8000-8080). Click Next.
- Action: Select Allow the connection (or Block the connection if your goal is to restrict traffic) and click Next.
- Profile: Choose when the rule applies:
- Domain: For corporate networks joined to an Active Directory domain.
- Private: For trusted home or work networks.
- Public: For untrusted networks (e.g., coffee shops, public Wi-Fi).
- Click Next.
- Name: Provide a recognizable Name (e.g., “Web Server Port 80”) and an optional description, then click Finish.
Step 3: Create an Outbound Rule (Outgoing Ports)
Outbound rules control traffic sent from your computer to external networks or servers.
- In the left navigation pane, click on Outbound Rules.
- In the right Actions pane, click New Rule….
- Rule Type: Select Port and click Next.
- Protocol and Ports:
- Select TCP or UDP.
- Select Specific remote ports and enter the designated port numbers. Click Next.
- Action: Choose Allow the connection or Block the connection, then click Next.
- Profile: Check the network profiles (Domain, Private, Public) where this rule should apply, then click Next.
- Name: Enter a clear Name and description for the outbound rule, then click Finish.
Managing and Modifying Existing Rules
- To Edit a Rule: Locate the rule in the Inbound Rules or Outbound Rules list, right-click it, and select Properties. Here you can change protocols, ports, scope, or actions.
- To Disable a Rule: Right-click the rule and select Disable Rule to temporarily turn it off without deleting it.
- To Delete a Rule: Right-click the rule and select Delete to remove it permanently.