I recently posted a way of getting the IP of the Raspberry Pi using NMAP. Talking with a friend reminded me that we can use netdiscover, too.

It works more or less the same way. With you Raspberry Pi connected to the network, you can do from you laptop, or computer or whatever:

$ sudo netdiscover -i wlan0 -r  
Currently scanning: Finished!   |   Screen View: Unique Hosts

6 Captured ARP Req/Rep packets, from 2 hosts.   Total size: 270

IP            At MAC Address      Count  Len   MAC Vendor

-----------------------------------------------------------------------------     64:16:f0:XX:XX:XX    05    210   Unknown vendor    b8:27:eb:XX:XX:XX    01    060   Unknown vendor

And it will send ARP packages to all the hosts in the range. I've only discovered two hosts, the router and the Raspberry Pi. You will know who is the Raspberry Pi because the MAC address will probably start with b8:27:eb. The difference between nmap is that netdiscover do not extract the vendor information from the OUI of the MAC (maybe the data base of vendors is outdated).

But, what happens if your network has about 40 hosts? It can be very difficult for you to detect the Raspberry, because you will not be able to distinct it from the other hosts. There is a better way. Connect the Raspberry Pi to the router and to the power. Wait 2 or 3 minutes, ensuring that the OS has loaded and the Raspberry Pi has a IP given from DHCP. Disconnect the network cable from the router, and connect it to your laptop. Execute the folloging command:

$ sudo netdiscover -i eth0 -r

The result must be exactly the same but it will only appear one entry in the list: the Raspberry Pi IP and MAC address.

And this is it, guys. Have fun!