Monday, September 25, 2023

network inventory or discovery - finding IP addresses of all hosts using nmap

I had written earlier about the arp command to check all the hosts on the network, but sometimes that does not work. It turns out nmap does a good job. Referencing https://www.redhat.com/sysadmin/quick-nmap-inventory

nmap 192.168.0.0/24

does a full scan of all hosts, 

(4 hosts up) scanned in 24.17 seconds

nmap -sn 192.168.0.0/24

does a quick scan, which only shows which hosts are up - in around 4 seconds.

The link above even shows how to do a packet trace using nmap, 

# nmap -vv -n -sn -PE -T4 --packet-trace 192.168.2.3

No comments:

Post a Comment