Step -1: Go to Windows Firewall, click Advanced settings
Step -2: Enable an rule
You can see the below options in the window
Inbound Rules
Outbound Rules
Connection Security Rules
You can select which rule that you wish to enable. It shows all pre-configured Windows Server rules associated with incoming packets and network connections . By default some of these rules are not enabled. If you want to enable any rule, right-click the rule and select Enable rule option.
Step -3: Create a new rule
Select Inbound or Outbound rules and go to the Action menu and select New Rule.
Step -4: Select the Port option and click Next.
Step -5: Define the port type to activate TCP or UDP
Step -6: Mention the port number
Step -7: Select Allow or block the connection and click Next
Step -8: Define the firewall profile as Public, Domain or Private and click Next
Step -9: Mention the new rule a name
Step -10: Click the Finish button to complete and create the new rule.