To configure Windows Defender Firewall, open the Windows Security app and select Firewall & network protectionFrom there, you can enable or disable the firewall for Domain, Private, or Public networks, allow specific apps through the firewall, or choose the Windows Defender Firewall with Advanced Security console for detailed settings and rule creation. To create a custom rule, navigate to the Inbound Rules or Outbound Rules section, right-click, and select New Rule to start the wizard for defining programs, ports, actions, and profiles.  
Using the Windows Security App (Basic Settings)
This method provides basic control over the firewall: 
  1. Open Windows Security: Click the Start button, type "Windows Security," and open the app. 
  2. Navigate to Firewall Settings: Select Firewall & network protection from the left-hand menu. 
  3. Select a Network Profile: Choose the network type you want to configure (Domain, Private, or Public). 
  4. Enable/Disable Firewall: Under the Microsoft Defender Firewall section, you can switch the setting to On or Off. 
  5. Allow Apps: Scroll down to find options like Allow an app through firewall for more granular control over specific applications. 
This video demonstrates how to access and use the basic settings in the Windows Security app:
Using Windows Defender Firewall with Advanced Security (Advanced Settings)
For more detailed configuration, use the advanced console: 
  1. Open Advanced Settings: Search for "Windows Defender Firewall with Advanced Security" in the Start menu and open it. 
  2. Create a New Rule: In the left-hand pane, select either Inbound Rules or Outbound Rules. 
  3. Start the Wizard: Right-click on the chosen rule type and select New Rule.... 
  4. Follow the Wizard:
    • Rule Type: Choose whether the rule applies to a Program, Port, or is a Custom rule. 
    • Program/Port: Define the program or TCP/UDP port the rule affects. 
    • Scope: Specify IP addresses for network traffic. 
    • Action: Select to Allow or Block the connection. 
    • Profile: Choose the network profiles (Domain, Private, Public) to which the rule applies. 
    • Name: Provide a descriptive name and description for your rule. 
  5. Finish: Complete the wizard to apply your new rule.