The most prominent way to block a program in a firewall is by setting inbound and outbound rules. Windows defender, a built-in host-based firewall, manages all these configurations on Windows. It also provides the option to choose the program you want to restrict communicating with the firewall. Today’s article discusses how you can block a program in a firewall using various graphical and CLI utilities.
Ways to Block a Program in Firewall
On Windows, there are graphical as well as command-line-based options for blocking a program in Firewall. Generally, the firewall can be manually configured from the Windows Defender settings. However, these configuration changes can also be done using the command lines from the Command prompt and PowerShell.
Block Programs on Public and Private Networks
From the firewall settings of Windows, you can restrict communication of a program through the Firewall. Furthermore, you can even assign a network (public or private) that can be used by the application.
Block Incoming Programs on Firewall
Users can also block the incoming connections for all the programs listed on the Allowed apps. This is done to enhance the security of the connection. After performing this, you will remain connected to the internet, but it will restrict receiving any incoming traffic for different apps.
Create a Firewall Rule
On Windows, you can add two control mechanisms to the firewall; the inbound and outbound rules. Inbound rules can be used to block internet traffic from unknown sources and restrict malicious programs from getting access to the network. Similarly, the outbound rules can be used to restrict selected programs from using the traffic exiting the firewall.
Using Command Prompt
On the Command prompt, you can use the netsh command line that can be used to configure the network settings. It is also possible to run the netsh from a batch file to modify your network configurations. Here’s how you can use this utility to block a program in the firewall. This command will set an inbound rule and block the chrome browser and restrict it from using the traffic received by the computer.
Using Powershell
PowerShell has a similar command-line utility to the netsh, which can be used to block a program in the firewall. Executing this command will add an outbound rule to the firewall for all network profiles (Domain, Private and Public) and prevent the chrome browser from accessing the internet.