Just a quick sanity check here.
Can you ping a specific port of a machine, and if so, can you provide an example?
I'm looking for something like ping ip address portNum
.
Just a quick sanity check here.
Can you ping a specific port of a machine, and if so, can you provide an example?
I'm looking for something like ping ip address portNum
.
You can't ping ports, as Ping is using ICMP which is an internet layer protocol that doesn't have ports. Ports belong to the transport layer protocols like TCP and UDP.
However, you could use nmap to see whether ports are open or not
Edit: As flokra mentioned, nmap is more than just a ping-for-ports-thingy. It's the security auditers and hackers best friend and comes with tons of cool options. Check the doc for all possible flags.
Open a telnet session to the specific port, for example:
To close your session, hit Ctrl+].
If you're on a windows installation with powershell v4 or newer, you can use the test-netconnection powershell module:
Example: Test-NetConnection example.com -port 80
This cmdlet also has the alias
tnc
. Egtnc example.com -port 80
You can use PaPing:
http://code.google.com/p/paping
Try
curl
command, like:For example:
Above command will return Fail on a non-zero exit status codes. In some particular cases, such as empty or malformed response (see
man curl
), you may want to handle specific exit codes as successful, so please check this post for more detailed explanation.No, you can't, because
ping
uses the ICMP protocol, which doesn't even have a concept of ports.I found a simpler solution using PsPing:
It's part of Windows Sysinternals.
On Linux you can use hping but it uses TCP, rather than ICMP.
Ping is very specific but if you want to check whether a port is open or not, and are running a Windows box then PortQry is your friend.
I've only used it for testing Domain Controllers for connectivity issues, but it worked a treat for that, so should work for you.