How to open a port in Windows Firewall
To open a port in Windows Firewall, you can follow below steps.
- Right-click the Start button >> Click Search

- Type Windows Firewall >> Click Windows Firewall >> Click Advanced settings.

- In the left frame of the window, click Inbound Rules >> In the right frame of the window, click New Rule

- Click Port >> Click Next.

- Click either TCP or UDP >> Click Specific local ports.

- Type a port number. (For eg, if we want to open port 1808) >> Click Next.

- Click Allow the connection >> Click Next.

- Click any network types you want to allow the connection over >> Click Next.

- Type a name for the rule >> Click Finish.

To open a port for outgoing traffic in Windows Firewall, you can follow the same steps mentioned above and you will need to choose Outgoing Rules instead of Inbound Rules and follow the remaining steps.
To close a port in Windows Firewall, you can follow the same steps mentioned above then follow steps
In Advanced settings >> Click Inbound Rules or Outbound Rules, depending on what type of rule you have created >> Click the rule you created >> Click the name of the rule in the right frame of the window >> Click Disable Rule >> Click Delete if you want to completely delete the rule.