Block a port in Windows 7 Firewall

If your Windows computer acts as a server to other computers on a network, then you may need to block a port for programs that require inbound access. For example, if you do not want any of the users on your network to start an HTTP server on port 80, then you can block port 80. You can block a port in the Windows Firewall using the steps shown below :

  1. Press the key combination Windows logo key + R to open the Run dialog.
  2. Type wf.msc in the Run dialog and press Enter. This would open the Windows Firewall with Advanced Secruity window.
  3. Click on the Inbound Rules in the left side menu in the Windows Firewall window as shown,

  4. Click on the New Rule… on the right side menu as shown,

  5. In the New Inbound Rule Wizard, select Port in Rule Type window and click Next,

  6. In the Protocols and Port window, select TCP or UDP ports. A webserver uses TCP port. Similarly, a bit-torrent client uses TCP port. We would be selecting TCP port in this example. Then click on Specific local ports. Then choose one port like 80, or a range of ports like 80-82 (all ports from 80 to 82). You can separate ports by a comma. The protocol type (TCP or UDP) and the number of port(s) depends on the program you are opening port for. Click Next to continue.

  7. In the Action window, select Block the connection and click Next,

  8. In the Profile window, select all options and click Next,

  9. In the Name window, give a name to the new rule like Web server and click Finish,