Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'How to find devices on your local network' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
How to find devices on your local network
Authored by: skully dazed on May 30, '06 09:30:46AM

If it doesn't respond to ping, you can still find the address like so:

x=0
while [ $x < 255 ]; do
    ping -c 1 192.168.1.$x &
    x=$(expr $x + 1)
done
# Wait a few seconds for the pings above to finish
arp -a

This will ping every address in your subnet (Adjust the local address as needed, and if your block is larger than a /24 you'll have to modify the script accordingly) and then show every machine that responded to the arp request. Even if it doesn't respond to a ping, it'll respond to the arp request. The ping is just used to generate the arp request.

I've used this to locate APs that blocked pings by default.



[ Reply to This | # ]
How to find devices on your local network
Authored by: lukasha on May 30, '06 06:11:01PM

Pardon my stupidity, but when I type that straight into terminal, I get "-bash:
255: No such file or directory" and when I put it in ultraping.sh and do a "sh
ultraping.sh" I get "ultraping.sh: line 2: 255: No such file or directory". How do I
use your instructions and can I make it into a command line command script?
Thanks in advance.

Jeff



[ Reply to This | # ]
How to find devices on your local network
Authored by: skully dazed on Jun 09, '06 05:28:23PM

Whoops. I make a mistake in my original post.

x=0
while [ $x -lt 255 ]; do
ping -c 1 192.168.1.$x &
x=$(expr $x + 1)
done
# Wait a few seconds for the pings above to finish
arp -a

Hopefully that works for people where my original didn't. :)



[ Reply to This | # ]