How to block and allow port in Windows
Windows firewall is an application provided by Microsoft Windows. This will filter the connections coming to server or system. Using Windows Firewall you can restrict the IP address and ports connecting to your server. Windows firewall will block unsolicited connection on network and increases the level of security of the system.
What Is Windows Firewall?
Basically Windows Firewall is a built-in system which is designed to filter incoming and outbound traffic. Traffic coming in and out of your Windows server will have a port which is designed to provide direction past the location of where the IP points to. So if you are an administrator then you might have observed a pop-ups when a program needs access and it will also ask you to confirm or deny the request. If it so then the Windows Firewall is not recognizing the IP which is trying to connect. By default Windows Firewall is doing its job by ensuring you are aware of the connection prior to the connection being made and avoiding potentiality harmful software packages.
A firewall is an essential aspect of computing and no computer should ever be without one. And for this reason today Windows has one bundled and active as standard. In Windows Firewall it occasionally has to be told to let a program communicate with the network, which is where opening ports comes in.
Firewalls are designed to protect a network from threats. These threats might be from outside which is trying to get in or threats from the inside trying to get out. This happens by blocking network enable ports. Because every time a program tries to communicate through this port, then the firewall will check its database of rules to check whether it is allowed or not. So if it doesn’t know, it will ask you - that is when and where sometimes you will see prompts asking you if a particular program is permitted to access the internet.
Follow the below steps to allow or block port using Windows Firewall:
Check whether Windows Server Firewall running on your server,
Control Panel >> All Control Panel Items >> Windows Firewall
Switch On Windows Firewall if the status is off.
Click on Advanced Settings.
Right Click on Inbound Rule and click on New Rule.
In the Rule Type dialog box, select Port, and then click Next.
In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the Database Engine, such as 80, 1443 for the default instance. Click Next.
In the Action dialog box, select Allow the connection OR Block the connection, and then click Next.
check all 3 options for rules to be applied.
In the Name dialog box, type a name and description for this rule, and then click Finish.