sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

FYI: via Raspi's IP address with 'arp-scan'

Mon Sep 16, 2013 8:41 pm

A FYI:

If you want to find the IP address of your Raspi somewhere on your LAN, there is handy method to do from your Linux or OS X system: use the command "arp-scan":

Code: Select all

sander@flappie:~$ sudo arp-scan --localnet --interface=wlan0 | grep b8:27:eb:
192.168.10.107	b8:27:eb:96:c4:2f	(Unknown)
sander@flappie:~$
So my Raspi is on IP address 192.168.10.107.
If your Linux / OS X system uses eth0 and not wlan0, fill out --interface=eth0.

If you have newer version of arp-scan (see http://ipv6-or-no-ipv6.blogspot.nl/2013 ... an-on.html how to install that from source) it will also tell it actually is a Raspi:

Code: Select all

sander@flappie:~$ sudo arp-scan --localnet --interface=wlan0 | grep b8:27:eb:
192.168.10.107	b8:27:eb:96:c4:2f	Raspberry Pi Foundation
sander@flappie:~$
AFAIK, arp-scan is not available on Windows.

HTH
Last edited by sander2 on Tue Sep 17, 2013 4:00 pm, edited 1 time in total.

User avatar
Mortimer
Posts: 927
Joined: Sun Jun 10, 2012 3:57 pm

Re: FYI: via Raspi's IP address with 'arp-scan'

Mon Sep 16, 2013 10:22 pm

On Snow Leopard :

Code: Select all

arp -a | grep "b8:27:eb"
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

Re: FYI: via Raspi's IP address with 'arp-scan'

Mon Sep 16, 2013 10:28 pm

ednl wrote:Interesting, but it's not included with OS X, at least not Lion which I'm on now. Also don't see it in the 'port' repository.
http://www.nta-monitor.com/tools-resour ... s/arp-scan says arp-scan works on OS X.

I know nothing about OS X itself, but does this help: https://code.google.com/p/rudix/downloa ... -1.8-0.pkg

Or build from source like described here for Ubuntu/Debian: http://ipv6-or-no-ipv6.blogspot.nl/2013 ... an-on.html

User avatar
Mortimer
Posts: 927
Joined: Sun Jun 10, 2012 3:57 pm

Re: FYI: via Raspi's IP address with 'arp-scan'

Mon Sep 16, 2013 10:48 pm

Arp-scan appears to be a download according to that link. The arp command is built into Mac OS X, and appears to be capable of fulfilling the command given by the OP.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

Re: FYI: via Raspi's IP address with 'arp-scan'

Tue Sep 17, 2013 5:43 am

Mortimer wrote:On Snow Leopard :

Code: Select all

arp -a | grep "b8:27:eb"
On Linux, arp will only show the IP/MAC combinations that the system has already used. So, it will only show the Raspi in that list if you have already 'contacted' it via it's IP address (via telnet, ping, http, etc).
That's on Linux. I expect it to be same on OSX.

arp-scan, however, will actively search for unknown IP/MAC combinations on your LAN/WLAN

User avatar
Mortimer
Posts: 927
Joined: Sun Jun 10, 2012 3:57 pm

Re: FYI: via Raspi's IP address with 'arp-scan'

Tue Sep 17, 2013 5:45 am

So ping the broadcast address then.
--------------
The purpose of a little toe is to ensure you keep your furniture in the right place.

User avatar
jojopi
Posts: 3402
Joined: Tue Oct 11, 2011 8:38 pm

Re: FYI: via Raspi's IP address with 'arp-scan'

Tue Sep 17, 2013 8:15 am

Mortimer wrote:So ping the broadcast address then.
If the Pi is running Linux, you missed a step:

Code: Select all

echo 0 |ssh pi@$IP_ADDRESS_OF_PI sudo tee /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
Then you can ping the broadcast address, and query your local arp cache for the IP to use in the previous step.

Or ping every address in your network. Or install arp-scan.

sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

Re: FYI: via Raspi's IP address with 'arp-scan'

Tue Sep 17, 2013 8:31 am

Mortimer wrote:So ping the broadcast address then.
Have you checked that that works for you? Not for me.

sander2
Posts: 60
Joined: Wed Jul 04, 2012 2:22 pm

Re: FYI: via Raspi's IP address with 'arp-scan'

Tue Sep 17, 2013 8:35 am

jojopi wrote:
Mortimer wrote:So ping the broadcast address then.
If the Pi is running Linux, you missed a step:

Code: Select all

echo 0 |ssh pi@$IP_ADDRESS_OF_PI sudo tee /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
Then you can ping the broadcast address, and query your local arp cache for the IP to use in the previous step.

Or ping every address in your network.
How can you know $IP_ADDRESS_OF_PI ... if you don't know it? Looks like a Baron-von-Münchhausen / recursive thing to me
jojopi wrote: Or install arp-scan.
Exactly

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: FYI: via Raspi's IP address with 'arp-scan'

Tue Sep 17, 2013 8:57 am

Unless your router is weird the IP addresses allocated by DHCP for newly detected equipment should be incremented by 1 i.e. 192.168.1.101, 192.168.1.102, 192.168.1.103 etc.
So if you know how many machines are connected or had been connected to the router then it's not difficult to work out the IP address of the Pi.
The other alternative is to setup a static IP address in /etc/network/interfaces then you won't have to worry about finding your Pi.

If you still need a software solution for monitoring ARP packets then try BinaryPlant's ARP Monitor - http://binaryplant.com/

Richard S.

Return to “Raspberry Pi OS”