21

I'm setting up a computer lab in which many Raspberry Pis are going to acquire IP addresses via DHCP. I'd like to have the DHCP server to differentiate between Raspberry Pis and other clients.

What are the Organizationally Unique Identifiers for the Ethernet cards on Raspberry Pis with which I might discriminate Raspberry Pis from other DHCP clients?

(I am aware that MAC addresses can be spoofed, and am assuming that the DHCP clients are not hostile.)

3

To elaborate the answer from @cachius: the OUI has changed from

B8-27-EB   (hex)         Raspberry Pi Foundation
B827EB     (base 16)     Raspberry Pi Foundation
                         Mitchell Wood House
                         Caldecote Cambridgeshire CB23 7NU
                         UNITED KINGDOM

to

DC-A6-32   (hex)         Raspberry Pi Trading Ltd
DCA632     (base 16)     Raspberry Pi Trading Ltd
                         Maurice Wilkes Building, Cowley Road
                         Cambridge    CB4 0DS
                         GB

according to http://standards-oui.ieee.org/oui.txt.

The Raspberry Pi 4 Model B already has the new OUI.

21

The best resource to find the most current OUI assignments is from the MAC Address Block Large (MA-L) Public Listing at the IEEE -- http://standards.ieee.org/develop/regauth/oui/public.html.

A complete list of OUI assignments is compiled daily and is available at http://standards-oui.ieee.org/oui.txt.

According to this list there is a single OUI/MA-L assignment for the Raspberry Pi Foundation:

>      B8-27-EB   (hex)         Raspberry Pi Foundation
>      B827EB     (base 16)     Raspberry Pi Foundation
>                               Mitchell Wood House
>                               Caldecote Cambridgeshire CB23 7NU
>                               UNITED KINGDOM
  • 1
    I can confirm it's still B8-27-EB on a Raspberry Pi 3 Model B – Eugen Aug 11 '17 at 19:40
6

According to the wikipedia article you linked,

In MAC addresses, the OUI is combined with a 24-bit number (assigned by the owner or 'assignee' of the OUI) to form the address. The first three octets of the address are the OUI.

So this is pretty straightforward; the first half of a MAC address is the OUI and the second half is arbitrary.

Low and behold, on the four pis I have here (two B's, one made in China, one B+, and one pi 2), the first three octets are:

b8 27 eb

Doing a bit of random searching online ("raspberry pi MAC address") also turns up this OUI.

2

In my very personal case.

recovery    b8:27:eb:c2:37:9d

OUI search

b8:27:eb

Find Results B8:27:EB Raspberry Pi Foundation

2

Both the Ethernet and the Wifi on the RPi3 (Raspberry Pi 3) have are prefixed b8:27:eb.

pi@raspberrypi:~ $ ifconfig | egrep "(ether|flags)"
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether b8:27:eb:ad:78:e4  txqueuelen 1000  (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether b8:27:eb:f8:2d:b1  txqueuelen 1000  (Ethernet)
2

It is worth noting that the MAC-48 number applies to the Network Interface and not the Host device and thus the B8:27:EB applies only to the wired EtherNet interface on older Raspberry Pi devices that do not have a built-in Broadcomm device providing Wireless networking!

A WiFi USB dongle added to give an RPi wireless-networking where it does not have it natively will have a OUI that is specific (one hopes) to the manufacturer - though there are now utilities to fake the whole MAC number for good (or evil) purposes. This is important should you be trying to find older RPis wirelessly and wondering why you cannot see MACs beginning with that value...

1

The Raspberry Pi 4 has

DC:A6:32:xx:xx:xx (Raspberry Pi Trading)

according to the Raspberry Pi Forums.

1

The below script can be used to find any vendor by Mac: Raspberry Pi or otherwise.

Just supply the vendor's name as it's specified in the IEEE's MAC DB:

"http://standards-oui.ieee.org/oui.txt"

in the variable "VENDOR" and of course replace the echo's in the conditional expression with something useful.

In its' present form it's meant to execute locally on a host, but the script could be adapted quite easily I imagine.

#!/bin/bash

#set -x

VENDOR='Raspberry Pi'
OUI=`ip addr list | grep -w link | awk '{print $2}' | grep -P "^(?!00:00:00)"| grep -P "^(?!fe80)" | tr -d ":" | head -c 6`

if [[ $( curl -sS "http://standards-oui.ieee.org/oui.txt" | grep -i "$OUI" | grep -o "$VENDOR" ) = 'Raspberry Pi' ]]; then
        echo "This is a Pi"
else
        echo "This is NOT a Pi"
fi

It is worth noticing, that the companyname (in the oui.txt) changed with the new Pi4:

  • B8-27-EB (hex) Raspberry Pi Foundation
  • DC-A6-32 (hex) Raspberry Pi Trading Ltd.
  • Thanks for the script! I edited it to still work with the different Raspberry company names that came with the Pi 4. – Stefan Wegener Oct 7 at 12:15
  • @StefanWegener Sooper-dooper! Thanks for helping keep answers current! – F1Linux Oct 7 at 12:18

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.