snm6og
Last Updated: February 25, 2016
·
5.693K
· poupougnac

Using nmap to quickly ping all hosts in an address range

I need sometime to have a quick look to check what's going on around on my network. Here how I do that :

To ping every ip from 192.168.0.1 to 192.168.0.254 :

nmap -sP -R 192.168.0.1-254

-sP means : PING

-R means : reverse-lookup to find the domain name

Host ar01-hill-hill.example.com (172.16.43.129) appears to be up.
MAC Address: 00:11:BC:7D:28:0A (Cisco Systems)
Host ccf-hill019-1.example.com (172.16.43.130) appears to be up.
MAC Address: 00:00:AA:63:54:BB (Xerox)
Host ccf-hill019-16.example.com (172.16.43.145) appears to be down.
Host ccf-hill019-17.example.com (172.16.43.146) appears to be down.
Host ccf-hill019-18.example.com (172.16.43.147) appears to be up.
MAC Address: 00:1E:C2:0D:C1:98 (Unknown)
Host ccf-hill019-19.example.com (172.16.43.148) appears to be down.
Host ccf-hill019-20.example.com (172.16.43.149) appears to be down.
Host ccf-hill019-21.example.com (172.16.43.150) appears to be down.
Host lordkris.example.com (172.16.43.151) appears to be down.
Host ccf-hill019-29.example.com (172.16.43.158) appears to be down.
Host ccf-hill019-30.example.com (172.16.43.159) appears to be down.
Nmap finished: 31 IP addresses (7 hosts up) scanned in 0.892 seconds

It shows you the MAC address if available (LAN)

Thanks to : http://blog.jasonantman.com/2010/02/using-nmap-to-quickly-ping-all-hosts-in-an-address-range/