Checking IP/Ports are open is easy enough. You can use various tools depending on your operating system:
On Windows:
- Use
telnet <IP address> <port>
in the Command Prompt. - If telnet is not enabled, you can enable it through Windows Features, or use PowerShell:
Test-NetConnection -ComputerName <IP address> -Port <port>
You can add -InformationLevel “Detailed” to the above command too.
The -InformationLevel
parameter allows you to control the level of detail included in the command’s output. When set to "Detailed"
, it instructs the command to provide a comprehensive set of diagnostic information about the network connection. This detailed output can include various technical details such as the route taken by packets, round-trip time, and other low-level data that can be useful for in-depth troubleshooting of network issues.
On Linux or macOS:
- Use the
nc
(netcat) command:nc -vz <IP address> <port>
- Alternatively, use:
telnet <IP address> <port>
-vz
are options where -v
stands for verbose, giving more details about the connection process, and -z
tells Netcat to scan without sending any data.
These commands attempt to establish a connection to the specified IP and port. If the connection is successful, it indicates that the port is open. If the connection fails or times out, it typically means the port is closed or not reachable.
I have related posts here: – Enhancing Local Development with Acrylic DNS, Connecting to a Kubernetes Cluster on Rancher with kubectl from Windows.
The official documentation for the PowerShell command is here: – https://learn.microsoft.com/en-us/powershell/module/nettcpip/test-netconnection?view=windowsserver2022-ps