How to Test if a TCP/IP Port is Open in Linux?

 

How to Test if a TCP/IP Port is Open in Linux?

Using telnet:

  1. Open the terminal on your Linux system.
  2. Type telnet <IP address> <port number> and press Enter. Replace <IP address> with the IP address of the server you want to test, and <port number> with the port number you want to test.
  3. If the port is open, you will see a message like "Connected to <IP address>."
  4. If the port is not open, you will see an error message like "Unable to connect to remote host: Connection refused."

Using nc:

  1. Open the terminal on your Linux system.
  2. Type nc -zv <IP address> <port number> and press Enter. Replace <IP address> with the IP address of the server you want to test, and <port number> with the port number you want to test.
  3. If the port is open, you will see a message like "Connection to <IP address> <port number> port [tcp/<service_name>] succeeded!"
  4. If the port is not open, you will see an error message like "nc: connect to <IP address> port <port number> (tcp) failed: Connection refused."

  1. Protocol
  2. IP address
  3. Subnet
  4. Gateway
  5. DNS
  6. DHCP
  7. Router
  8. NAT
  9. Firewall
  10. Port
  11. TCP
  12. UDP
  13. Routing
  14. Network
  15. Internet

Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.