Note: I assume the addressing space of the local network is 192.168.1.1/255.255.255.0
.
for ip in $(seq 1 254); do ping -c 1 192.168.1.$ip>/dev/null; [ $? -eq 0 ] && echo "192.168.1.$ip UP" || : ; done
Install arp-scan
. On Mac with homebrew:
brew install arp-scan
on Ubuntu/Debian with apt-get:
sudo apt-get install arp-scan
Scan local network:
sudo arp-scan -l
Scan local network specifying network interface (it might be required if arp-scan is not able to decide which one to use):
sudo arp-scan --interface eth0 -l
Specify a range:
sudo arp-scan 192.168.1.1-192.168.1.50
``