# Using the Terminal to ping a port number?



## StarBuck (Mar 14, 2004)

Hi,

Is it possible to ping a port number in the terminal?

Thanks


----------



## bob@bomar.us (Mar 14, 2004)

You can telnet to a specific port on a remote host to test that it responds:

[bob@freebird] ~> telnet dakota 25
Trying 192.168.1.10...
Connected to dakota.
Escape character is '^]'.
220 dakota.bomar.us ESMTP Postfix
^]
telnet> quit
Connection closed.


----------



## StarBuck (Mar 14, 2004)

To get around this I have been using telnet, you can do it in windows ok so you must be able to do it in OS X.


----------



## Giaguara (Mar 14, 2004)

You can as well use Nrtwork Utility. It is in Applications / Utilities folder.


----------



## bob@bomar.us (Mar 14, 2004)

Ping uses ICMP Packets, first type 8, ECHO, then the response, type 0, ECHO_REPLY, these packets are datagrams, and therefor can not attach to ports since they act on layer 1 and 2, but do not go up to layer 3 or above, so they will stay in the NIC and not go into the TCP/IP Stack in the kernel.

IIRC, when you do a ping in Windows, and specify a port, its an actual TCP packet, and not an ICMP packet.

You have to remember, OS X is very standards compliant, more than other OS's, therefor, the "features" in other OS's might not work, but what does work, works as per the RFC/standards that define them.


----------



## scruffy (Mar 14, 2004)

you need nmap.

http://www.insecure.org/nmap for the latest version.  Fink has a very outdated version also.


----------

