How to get the MAC address of a Raspberry Pi

Learn two distinct approaches to retrieve the MAC address of your Raspberry Pi 4 in this detailed tutorial.

Series - Raspberry Pi Tips

If you do have an HDMI cable, connect it to a screen and boot the Raspberry Pi without an SD card. When it boots up, it will show a screen with different information about the board. At the end of the board line, you can see the MAC address.

If for any reason you don’t have the HDMI cable to connect the Raspberry Pi with, you can do it with arp-scan from your machine.

To install arp-scan on a Debian based system, run the following:

1
sudo apt install arp-scan

To install arp-scan on an Arch based system, run the following:

1
sudo pacman -S arp-scan

Now that you have it installed, find out the name of the local interface, ethernet or wireless by doing the following:

1
ip a

This will list the available interfaces, and you should look for the one which says state UP in the description. If your interface is called eth0 for example, run the following to get the MAC address of the Raspberry Pi:

1
sudo arp-scan --interface=eth0 --localnet

This will return a list of devices connected to the local network, and you should look for the one which says something like Raspberry Pi Limited, Or simply get it in a single command without looking through a list:

1
sudo arp-scan --interface=eth0 --localnet | grep 'Raspberry`