linuxwindowsnetwork-programmingping

Is there a way to check if a certain port is open on server?


Just as you'd ping an IP of to a server to check if it is up, can we also check if, on that running server, a port is active/open?

this just comes from my head,but can you be more specific in your ping statement?

 `ping 127.0.0.1:7004`

I know this command is not allowed, but is there a way to check for this in Linux and Windows?


Solution

  • That depends upon your access to system (client or server), You can use either of two options,

    1. Server side you can use netstat -an to check which ports are listening
    2. From outside use just telnet host port, if it is not working on linux machines try telnet host:port.