Robert Citek wrote about this on the CWE-LUG list a while back, & I thought y'all might find it interesting.
For example, when I want to know all the MAC address and IP addresses on my LAN, I do the following:
# ping -b -c 2 -W 1 192.168.1.255
# arp | grep ethalthough I find this for-loop gives me more complete results:
# for i in $(seq 1 254) ; do ping -c 2 -W 1 192.168.1.$i >& /dev/null & done
# arp | grep ethThe above works great if I know the network I'm on. But what if there is a device that is using a different network IP, e.g. 10.1.1.1? For example, we discovered serendipitously through using ethereal that one of our wireless switches was doing just that.
Now, here's how I would do the same thing, using the fantabulous nmap:
# nmap -sP -PI -PT 192.168.0.1/24
Of course, Robert's examples assume that his network's addressing uses 192.168.1.x, while mine assumes 192.168.0.x, but you probably saw that anyway. :)
By the way: anyone got an answer for Robert's question?
(Check out all of my posts on networking.)







