Connecting several Raspberry Pi using ethernet only with MAC addresses

I have several Raspberry Pi connected to an ethernet hub. Every Raspberry Pi knows all the MAC addresses of the other Raspberry Pi connected to the hub.

Is there any way to make them communicate without the need to set up IP addresses and only using the MAC addresses?

The communications protocol that I need is very simple:

  • One Raspberry Pi is the master and always starts the communications.
  • It sends a message to another Raspberry Pi using the MAC address.
  • The addressed Raspberry Pi replies back to the master with the requested information.

Ideally, I’m looking for some kind of library that exists already and that I could use.

>Solution :

What you’re planning to do it not generally advised as there’s minimal error handling in the data link layer. So, you’re going to have problems making sure packets are successfully received, let alone getting a reply.
Using layer 2 (data link layer) comes with its own problems and does not necessarily increase the link speed, as Raspberry Pi supports 1GBs ethernet.
I believe the only reason behind such question is to evade the hassles of changing dynamic IPs. You could always set static IPs for your RPis and target them using Http and such.

That being said, you could give python full access to the ethernet driver using this qustion.
Communicate on the data link layer (prior to obtaining IP address) with Python

Leave a Reply