LAN
Check all hosts connected to the Local Area Network
_$: sudo nmap -sP 192.168.1.0-254
Or ping broadcast, although it will probably not work:
_$: ping -b 192.168.1.255 -c1
Or scan your whole network:
/home/<user>/scripts/net-check-local.sh:
----------------------------------------
#!/bin/bash -
if [[ -x /usr/bin/fping ]]
then
printf "Using fping [fast]...\n"
for ip in {1..255}
do
fping -c 1 -t 100 192.168.1.$ip &> /dev/null && printf "IP %s:OK\n" $ip
done
else
printf "Using ping [slow]...\n"
for ip in {1..255}
do
ping -c 1 -W 1 192.168.1.$ip &> /dev/null && printf "IP %s:OK\n" $ip
done
fi
_$: ./net-check-local.sh
Using fping [fast]...
IP 1:OK
IP 133:OK