Oh, this is weird... I was working on a different issue, and found something that might offer an explanation:
You can refresh the ARP cache in your PC (Mac in my case) like this:
#!/bin/sh
: ${1?"Usage: $0 ip subnet to scan. eg '192.168.1.'"}
subnet=$1
for addr in `seq 0 1 255 `; do
( ping -c 3 -t 5 $subnet$addr > /dev/null ) &
done
This script (call it pingpong.sh
), simply pings all possible IP addresses in your subnet, just in order to refresh your host's ARP cache. Once the cache is refreshed, do this to learn what IP address your Raspberry Pi has been assigned:
arp -a | grep b8:27:eb [see Note 1 below]
I have an RPi 3B+ on which WiFi is enabled, and the Ethernet port is jacked into my switch. Here's what I see as output from the above:
? (192.168.1.27) at b8:27:eb:cd:2f:ff on en0 ifscope [ethernet]
? (192.168.1.28) at b8:27:eb:cd:2f:ff on en0 ifscope [ethernet]
I'm surprised and confused to learn that both WiFI and Ethernet have the same MAC address. It seems to me this could lead to confusion, but I'm not sure. Anyway, just be aware of it I guess - that's my answer... and my question :)
EDITED 20200104
NOTE 1: As of the RPi ver 4B, the OUI has changed
FROM: b8:27:eb
TO: dc:a6:32
. The
arp
command to find either is:
arp -a |grep -E --ignore-case 'b8:27:eb|dc:a6:32'