Skip to content

Instantly share code, notes, and snippets.

@cheton
Forked from niun/find-raspberry.sh
Created July 3, 2018 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cheton/2a3f0f9d9ee1dcdb56ad797aec6919bc to your computer and use it in GitHub Desktop.
Save cheton/2a3f0f9d9ee1dcdb56ad797aec6919bc to your computer and use it in GitHub Desktop.
Find Raspberry Pi in network (looking for MAC address vendor prefix of Raspberry Pi Foundation using nmap, awk for ipv4 / ping6, ip, grep for ipv6 neighbour discovery)
sudo nmap -sP 192.168.0.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'
IFACE=eth0
# trigger IPv6 neighbour discovery with link-local scope multicast:
ping6 -c2 -I $IFACE ff02::1 > /dev/null
# print the results, filtered by MAC address vendor prefix of Raspberry Pi Foundation:
ip -6 neigh | grep b8:27:eb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment