nmap: easily Ping-Scan all addresses in my subnet
I don't think that there is a way with doing that with nmap
alone, but you could script it:
Here is a quick and dirty solution:
#!/bin/bash
IP_AND_MASK=`ifconfig | grep "inet addr" | head -n1 | sed 's|.*addr:\([0-9\.]*\).*Mask:\([0-9\.]*\)|\1/\2|g'`
NETWORK=`ipcalc "$IP_AND_MASK" | grep "Network:" | sed 's|^Network:\s*\([0-9/\.]*\).*|\1|g'`
nmap -sP "$NETWORK"
You have to install ipcalc
to make that solution work.
hth