Skip to main content

nmap: how to scan entire subnet (part-4)

Scan an Entire Subnet
Nmap can be used to scan an entire subnet using CIDR (Classless Inter-Domain
Routing) notation.

 
Usage syntax: nmap [Network/CIDR]
 
$ nmap 192.168.10.1/24
Starting Nmap 5.00 ( http://nmap.org ) at 2009-08-07 20:43 CDT
Interesting ports on 192.168.10.1:
Not shown: 996 filtered ports
PORT
STATE
SERVICE
20/tcp closed ftp-data
21/tcp closed ftp
23/tcp closed telnet
80/tcp open
http
Interesting ports on 192.168.10.100:
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
139/tcp open netbios-ssn
445/tcp open microsoft-ds
2049/tcp open
nfs
Nmap done: 256 IP addresses (2 hosts up) scanned in 8.78 second
Scanning an entire class C subnet using CDIR notation


The above example instructs Nmap to scan the entire 192.168.10.0 network using
CIDR notation. CIDR notation consists of the network address and subnet mask (in
binary bits) separated by a slash. See Appendix C for a cross reference of subnet
masks and their CIDR notations.