4

I have a number of Raspberry Pi 2 and need to know the MAC addresses of these before installation. Is there a way to get or deduce the MAC address given access to the physical Pi but without having to boot it up and connect to a display?

  • 2
    You don't have to connect it to a display, just put a card with an OS on in, attach it to ethernet, plug it in, wait a minute, get the MAC address from the network, unplug it. Pretty much all distros should get online without any configuration via cable. – goldilocks Jun 22 '15 at 13:37
2

There's no way to achieve what you need without booting up. Even though there might be a register at Raspberry HQ connecting the sticker and MAC address, it's not available for the public.

To identify, deploy and maintain an array of Pi's I have a seperate SD card which I insert to every new Pi and boot once. MAC and Serial is then send to a php script on an external server.

pidentify.sh

wget http://example.org/pidentify.php?serial=`grep -Po '^Serial\s*:\s*\K[[:xdigit:]]{16}' /proc/cpuinfo`&mac=`ip link show eth0 | awk '/ether/ {print $2}`

pidentify.php:

<? file_put_contents('register/'.date('Y-m-d_H:i:s_').uniqid().'.txt', serialize($_REQUEST)); ?>

*** The matrix sticker might be connected to the serial number (read: the processor's serial number). Even if it does, I personally find my workflow easier.

  • Update: Today I've been playing with the sticker contents but couldn;t find any connection. I did find out that the MAC address is build as AA:AA:AA:BB:BB:BB where A is always B8:27:EB (Reserved MAC range for Raspberry Pi Foundation), and B is the ARM serial number. – EDP Jul 13 '15 at 20:07
  • does your workflow require removing /etc/udev/rules.d/70-persistent-net.rules every time? I am just wondering if I am missing something? – Daniel C Sep 1 '15 at 16:16
  • I don't understand your question. Nothing to remove. pidentify.sh should run on the pi, pidentify.php should run on a remote webserver of course. – EDP Sep 1 '15 at 16:20
  • Whenever I use a previously used SD card on a PI, I have to clear that file or I find that the eth0 interface doesn't seem to come up. Perhaps the problem is not universal: raspberrypi.stackexchange.com/questions/26155/… – Daniel C Sep 1 '15 at 16:40
  • I always put an original non-modified raspberry image on my disks and do the updates and filesystem expansion manually (but via a script of course). Therefore I never had that mac-eth0-binding issue. I suggest you do the same. At first hand it looks like going manually would eat up precious time compared to flashing with a up to date image, but it's just the opposite. – EDP Sep 2 '15 at 9:11
0

I don't think there's a way. No.

However, it is possible to get it without connecting display by connecting it via SSH. But clearly, you don't want to boot it up so it is out of question. Hope it helps.

0

By MAC address I guess you mean the MAC address of the on-board Ethernet controller.

The answer is no, the MAC is not printed on the Pi2. I suppose you could ask the manufacturers to start printing the information on the Pi or the delivery package.

I believe the address is held within OTP memory on the PI2. The device needs to be booted for you to get the MAC.

  • There is some sort of unique number printed as a data matrix next to the SD card holder. By comparing two of those number with their respective MAC addresses I couldn't find any obvious connection though. – moonhouse Jun 22 '15 at 14:53
  • @moonhouse Can you read the code? Mine includes a printed 24/01 but I have no ability to read the code itself. – joan Jun 22 '15 at 15:27
  • @moonhouse any reference to what you're claiming ? – dhruvvyas90 Jun 22 '15 at 18:06
  • @joan I used boy.co.ua/decode.php to decode the data matrix. – moonhouse Jun 23 '15 at 15:02
  • @dastaan If I can reference my claim that the number in the data matrix is unique? No, I can only conclude that the data matrices of three Raspberry Pi 2 are different from each other. It's a 16 digit code, all three starting with 000001100216 and then different in the last four digits. – moonhouse Jun 23 '15 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.