# How to Ping a IP Range in the Terminal?



## StarBuck (Jul 20, 2004)

Hi quick question I hope for someone out there, how do you ping a ip range in the terminal?

I want to ping 192.168.1.1 to 254 via the terminal.

Ta


----------



## michaelsanford (Jul 20, 2004)

I'd use nmap (fink-able package) with the following string:

*nmap -sP -T Insane 192.168.1.1-254*

You should get an output like:
_Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Host (192.168.0.1) appears to be up.
Host (192.168.0.100) appears to be up.
Host (192.168.0.110) appears to be up.
Nmap run completed -- 254 IP addresses (3 hosts up) scanned in 3 seconds_


----------



## StarBuck (Jul 20, 2004)

With the help of a friend here is the answer.

ping the address like this ping 192.168.0

this will then scan your network range but this doesn't seem to find everything.


----------



## twister (Jul 20, 2004)

www.dnsstuff.com  maybe that's easier.


----------



## scruffy (Jul 20, 2004)

as far as I can tell, that doesn't actually work that way - 192.168.0 just gets filled in to 192.168.0.0

You'd be best off using nmap


----------



## michaelsanford (Jul 20, 2004)

scruffy said:
			
		

> as far as I can tell, that doesn't actually work that way - 192.168.0 just gets filled in to 192.168.0.0
> 
> You'd be best off using nmap



Also, dnsstuff.com isn't from the Terminal, unless, I guess, you use lynx ::ha::


----------



## Pengu (Jul 20, 2004)

try using 192.168.0.255 (broadcast address)


----------



## scruffy (Jul 21, 2004)

That ought to work in general, but I can see two potential problems:
- if different hosts have different configured subnet masks, some will consider 192.168.0.255 to be a broadcast to the 192.168.0.0/24 network, others will consider it to be a specific computer in the 192.168.0.0/16 network.
- some operating systems or firewalls might drop broadcast echo replies, to avoid traffic multiplication bombs or similar attacks.

I don't know what the reason is, whether it's one of the two I thought of, or some other but: At home I have two macs at 192.168.0.3 and 192.168.0.4, and the router is at 192.168.0.1.  If I ping 192.168.0.255, I get responses from the macs, but not the router.  I have to ping 192.168.0.1 to get a response from the router.


----------

