OldPCGuy
Posts: 82
Joined: Mon Jan 02, 2017 4:53 pm
Location: Detroit Michigan

Two MAC Addresses 1 Pi

Sun Mar 11, 2018 3:57 pm

I'm in the process of setting up a MQTT broker on a Pi-3 and interface with an iPhone app. When I went to assign a dedicated I/P for the Pi/broker I discovered two MAC addresses emanating from the Pi, eth0 and Wlan.

Do I assign each MAC to the same static I/P? what happens if wired and wireless are both active?

epoch1970
Posts: 3564
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Two MAC Addresses 1 Pi

Sun Mar 11, 2018 6:31 pm

OldPCGuy wrote:
Sun Mar 11, 2018 3:57 pm
Do I assign each MAC to the same static I/P? what happens if wired and wireless are both active?
Normally you can't do that. You should preferably use DHCP or assign 2 different addresses manually.
Then contact the machine by name, e.g. "raspberrypi.local". From reasonably modern machines the name will resolve regardless of the address or interface actually used.
Raspbian gives preference to ethernet when wifi and ethernet are available.

However with raspbian/systemd/dhcpcd (I don't know who is to blame) this heresy will "work".
(It works by deleting behind the scenes one of the interfaces from the system in order to resolve the conflict...)
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Networking and servers”