Windows Firewall is a Microsoft program that blocks most programs from communicating with your system to filter harmful programs from external sources and the internet. It also protects your system from unauthorized access attempts when using public networks.
If you are using Windows Firewall, you should now open the PortNumber you have chosen in that firewall. The firewall will then accept the connection to your chosen port.
Different operating systems use different firewalls to manage ports. This is something that is done by the Windows built-in firewall in the case of Windows VPS.
We have 3 ways to do this in the Windows VPS firewall:
First, execute the run with Windows key + R keys, type wf.msc , and press OK.
Now choose Inbound Rules and then click on the New Rule…
Select the port and then click on Next.
Write the Port Number that you want to be opened and click Next.
Choose to Allow the connection and then click Next.
Choose an available situation and then click Next.
Write a custom name for the number you want to open and then click Next.
Reboot the server to apply the changes.
This time, use the Windows key + R and type CMD and press OK.
Type this code.
netsh advfirewall firewall add rule name="Port 20875" dir=in action=allow protocol=TCP localport=20875
Note: The name section is your custom name, and the local port section, is the number of the port you want to open.
Reboot the server to apply the settings changes.
execute the run using the (Windows key + R), type PowerShell, and then press OK.
you should type this command on Powershell :
New-NetFirewallRule -DisplayName "Port 6985" -Direction inbound -LocalPort 6985 -Protocol TCP -Action Allow
Reboot your server to apply changes.
Note: In the DisplayName field, you must write the name of the port you want, and in the -LocalPort field, you must write the number of the port you want to open.
Windows Firewall is silent and protects you from all known threats. It was first introduced in Windows XP and has been improved in each new version, allowing you to access the network and the Internet while protecting your computer or device from the local network or Internet attacks.