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?

Purpose

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

Resolution

On a Windows computer

On a Mac computer (before macOS 11 Big Sur)

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 1723 or telnet 10.17.xxx.xxx 5000) to run the telnet command and test the port status.

Via a third-party website

  1. Click Check to test the port status.

  2. If the port is open, a message will say Port XXX is open on XXX.XXX.XXX.

Last updated