Closing an Open Port

Written by Barry Dysert (last updated September 17, 2018)

4

In the tip titled Scanning Your System for Open Ports you discover how to see what ports are open on your computer. If you want to close an open port, you can do so by using the Windows Firewall (Windows Defender Firewall for Windows 10). For example, let's say you want to close port 5500 for all inbound connections. Perform the steps outlined below.

  1. Open Windows Firewall by going to Start | Control Panel | Windows Firewall. If you are using Windows 10, type "Windows Defender Firewall" (without the quotes) in the Search box. (See Figure 1.)
  2. Figure 1. Windows Defender Firewall opening screen.

  3. On the left, click the "Advanced Settings" link. (See Figure 2.)
  4. Figure 2. Windows Defender Firewall advanced settings.

  5. On the left, click the "Inbound Rules" link. Windows displays a list of all the firewall's inbound rules.
  6. Right-click the "Inbound Rules" link, and from the resulting Context menu select "New Rule." Windows displays the first step of the New Inbound Rule Wizard. (See Figure 3.)
  7. Figure 3. Step 1 of the New Inbound Rule Wizard.

  8. Since you want to close a particular port, click the Port radio button and click Next. The wizard allows you to specify which port you want to affect. (See Figure 4.)
  9. Figure 4. Step 2 of the New Inbound Rule Wizard.

  10. You want the rule to apply to TCP, so click that radio button and also type "5500" (without quote marks) into the text box. Then click Next to move to the next wizard step. (See Figure 5.)
  11. Figure 5. Step 3 of the New Inbound Rule Wizard.

  12. Click the Block the Connection radio button and click Next to display the next wizard step. (See Figure 6.)
  13. Figure 6. Step 4 of the New Inbound Rule Wizard.

  14. Ensure that all three checkboxes are marked and again click Next to move on. (See Figure 7.)
  15. Figure 7. Step 5 of the New Inbound Rule Wizard.

  16. Type in a name for the rule and optionally type a description, then click Finish.

Port 5500 is now closed and cannot be used by any service.

 This tip (13105) applies to Windows 7 and 10.

Author Bio

Barry Dysert

Barry has been a computer professional for over 35 years, working in different positions such as technical team leader, project manager, and software developer. He is currently a software engineer with an emphasis on developing custom applications under Microsoft Windows. When not working with Windows or writing Tips, Barry is an amateur writer. His first non-fiction book is titled "A Chronological Commentary of Revelation." ...

MORE FROM BARRY

Changing an Account's Picture

You may want to customize your account so that it uses a picture of your own choosing. This tip tells you how to change ...

Discover More

Running a Batch File at a Scheduled Time

Once you become comfortable with batch files, chances are that you'll want to use them to perform various system ...

Discover More

Disabling Automatic Driver Installation

Whenever you plug something into your computer, Windows dutifully tries to find and install the driver for your new ...

Discover More
More WindowsTips

Adjusting Print Margins in Microsoft Edge

Printing hard copies of web pages can be difficult when you want the printout to have margins suitable for storing the ...

Discover More

Disable Edge Chromium Background Processes after Closing

Edge Chromium allows for many new improvements, features, and enhancements. One feature, Background Processes, can use up ...

Discover More

Saving System Resources with Sleeping Tabs

When more system resources are used by your web browser, your computer will slow down. Turn on sleeping tabs to help free ...

Discover More
Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 5?

2021-05-04 20:13:39

Jaqi

I don't understand. What if the connection I want to block is a long number like 127.0.0.1:49780???? How do I block them?


2021-04-18 10:03:02

widowsuser2021india

Dear Sir,

I have used your given method to closed Ports 21, 22, 23. After applying this rule, method i scan with zenmap then it shows ports 21,22,23 are still open. so this method practically does not work i think plz check from your end & given clarity on it in this article new update


2018-10-09 01:33:48

Barry

Thanks for the kind words, Peter. As you probably know, one big way that hackers are able to penetrate a system is through unused open ports. So as a general practice, it's a good idea to close ports that aren't being used. It's a safely precaution.


2018-10-09 01:28:44

Peter J Moran

Hi Barry,

As per your usual quality, a most detailed tip.

Could you please give some indication as to why one of us mere mortals might want or need to follow your detailed instructions.

Does the PC need to indicate errors on the port, or might it be that one is trying to stop some sort of intrusion into the PC?

It seems to me a bit like someone giving me a special spanner, showing me how it works, but not telling where or when I need to use it.

Many thanks for your valuable weekly input.


Newest Tips