30

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 (OUIs) 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.)

Peter Mortensen
  • 1,984
  • 2
  • 14
  • 17
200_success
  • 407
  • 1
  • 4
  • 9

9 Answers9

22

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
jdcarp
  • 321
  • 1
  • 2
14

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.

Add also

E4-5F-01   (hex)        Raspberry Pi Trading Ltd
E45F01     (base 16)    Raspberry Pi Trading Ltd
                        Maurice Wilkes Building, Cowley Road
                        Cambridge    CB4 0DS
                        GB
Ingo
  • 40,606
  • 15
  • 76
  • 189
  • Why did it change? – james-see Nov 19 '19 at 17:28
  • @jamescampbell I don't know. I guess because the company has changed. The first bytes of a mac address are the companiy id. – Ingo Nov 19 '19 at 18:13
  • that makes sense to me. Thanks – james-see Nov 20 '19 at 19:52
  • 1
    @jamescampbell: I don't know precisely why the company changed, but FYI, the original OUI was registered to the [Raspberry Pi Foundation](https://www.raspberrypi.org/) - a "registered charity" in the UK. UK laws govern finances of charities, and of course charities are not permitted to make a "profit". [Here's a thumbnail sketch of their finances.](https://beta.charitycommission.gov.uk/charity-details/?subid=0&regid=1129409) It seems a reasonable guess that money is behind the decision, more specically how it is accounted for and distributed. – Seamus Dec 07 '19 at 19:20
  • @Seamus thanks for that context – james-see Dec 09 '19 at 16:41
7

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.

Lo 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.

Seamus
  • 18,728
  • 2
  • 27
  • 57
goldilocks
  • 56,430
  • 17
  • 109
  • 217
3

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.
Dougie
  • 4,940
  • 7
  • 14
  • 27
F1Linux
  • 1,589
  • 1
  • 9
  • 28
2

The Raspberry Pi 4 has

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

according to the Raspberry Pi Forums.

cachius
  • 121
  • 1
2

To add to what @Ingo said, they actually have a third OUI now: E4-5F-01

Not sure why that happened either, but I have hardware with a MAC with that OUI.

I'd have commented that, but don't have enough reputation.

ajs124
  • 21
  • 1
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

user51998
  • 21
  • 1
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)
fadedbee
  • 123
  • 4
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...

SlySven
  • 3,581
  • 1
  • 15
  • 44