> For the complete documentation index, see [llms.txt](https://learnimportant.gitbook.io/learn-important/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learnimportant.gitbook.io/learn-important/windows10/how-do-i-know-if-a-tcp-port-is-open-or-closed.md).

# How do I know if a TCP port is open or closed?

https\://www\.synology.com/en-global/knowledgebase/DSM/tutorial/Network/Whether\_TCP\_port\_is\_open\_or\_closed

## How do I know if a TCP port is open or closed? <a href="#b_1" id="b_1"></a>

### Purpose&#x20;

This article explains how to check if a TCP port is open or closed on different operating systems when you suspect that any of the following issues resulted in a closed port:

* The port forwarding rule is incorrectly configured.
* The external IP address is set to a private IP address.
* The network connection is blocked by firewall rules.
* The service is not working properly.

### Contents

* [On a Windows computer](https://www.synology.com/#x_anchor_id4)
* [On a Mac computer (before macOS 11 Big Sur)](https://www.synology.com/#x_anchor_id5)
* [On a Linux computer](https://www.synology.com/#x_anchor_id6)
* [Via a third-party website](https://www.synology.com/#x_anchor_id7)

### Resolution

#### On a Windows computer

1. Press the **Windows key** and type "Windows features" in the search bar. Then, select **Turn Windows features on or off**.\
   ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/1.png)
2. Tick the **Telnet Client** checkbox and click **OK**.\
   ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/2.png)
3. Press the **Windows key + R**, then type "cmd.exe" and click **OK**.\
   ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/3.png)
4. Enter "telnet + IP address or hostname + port number" (e.g., *telnet [www.example.com](http://www.example.com) 1723* or *telnet 10.17.xxx.xxx 5000*) to run the telnet command in **Command Prompt** and test the TCP port status.\
   ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/4.png)
5. If the port is open, only a cursor will show.\
   ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/5.png)If the port is closed, a message will say **Connect failed**.\
   ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/6.png)

#### On a Mac computer (before macOS 11 Big Sur)

1. Click the **Spotlight** icon ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/7.png) in the upper-right hand corner or press **Command + Space bar**.
2. Type "Network Utility" in the search field and select **Network Utility**.\
   ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/8.png)
3. Select **Port Scan**, enter an IP address or hostname in the text field, and specify a port range. Click **Scan** to begin the test. If a TCP port is open, it will be displayed here.\
   ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/9.png)

#### On a Linux computer

1. Open **Terminal** on your Linux computer.
2. Enter "telnet + IP address or hostname + port number" (e.g., *telnet [www.synology.com](http://www.synology.com) 1723* or *telnet 10.17.xxx.xxx 5000*) to run the telnet command and test the port status.
3. If the port is open, a message will say **Connected to 10.17.xxx.xxx**.\
   ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/10.png)If the port is closed, a message will say Connection refused.\
   ![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/11.png)

#### Via a third-party website

1. Go to [yougetsignal.com](https://www.yougetsignal.com/tools/open-ports/).
2. Fill in the IP address or hostname into the **Remote Address** field and the port number into the **Port Number** field.![](https://www.synology.com/_images/autogen/Whether_TCP_port_is_open_or_closed/12.png)
3. Click **Check** to test the port status.
4. If the port is open, a message will say **Port XXX is open on XXX.XXX.XXX**.
