Duplicate MAC addresses

Jul 06, 2022 Last reply: 4 years ago 60 Replies

Two Raspberry Pi 3s purchased about a year apart turned out to have duplicate MAC addresses. Anybody else seen this?



A correspondent told me about a config.txt variable force_mac_address which seems to have worked around the problem. I incremented the last digit by one and all seems well, but it was a real hair puller for six months. Kept thinking it was an error on my part.



Thanks for reading,



bob prohaska


Not with RasPis, but a couple of decades ago, I was purchasiing and setting up an information system for the local airport. There were about 50 PC's as terminals, and the system worked fine, but only with one terminal.

It made no difference which of the PC's was used, as soon as a second one was connected to the network, everything went awry, including messed IP addresses by DHCP.

It took some time before we had a look at the MAC addresses, all the Ethernet cards had the same address.

After all the network cards were swapped, everything did run fine.

I'm surprized. It's the sort of thing one expects with cheap copycat knockoffs.

Have you put anything on the rpi forum?

I run arpwatch on my lan server. If your Pi's have fixed IP configs, not DHCP, then it would tell you about the MAC address flipping between different IPs.

cheers Jim

Not until you asked 8-) Most of the hits were about Ethernet adapters, but I did find this gem:

[quote} The trouble is, there are more Pi in the wild than there are unique serial numbers... Not sure what the odds of hitting two with the same serial number are though [endquote]

Never would have thunk it.....

Thanks for writing,

bob prohaska

On a sunny day (Wed, 6 Jul 2022 15:28:57 -0000 (UTC)) it happened bob prohaska snipped-for-privacy@www.zefox.net> wrote in <ta49np$2f7v$ snipped-for-privacy@dont-email.me:

Yea, wrong MAC .. there is a hacking opportunity too there, if someone's WiFi security setting is allowing only specific MACs then you could pose as one of those... Ran into that many many years ago, still on my site:

formatting link
Have not tried changing raspi MACs, thanks for mentioning the force_mac_address.

Am Mittwoch, 06. Juli 2022, um 15:28:57 Uhr schrieb bob prohaska:

Please check if they really have the same MAC address when booted from a new installed OS. It is possible to change the MAC address. The MAC address of the physical interface (not any virtual interface) should have an unique MAC address by default from the vendor. You can override this if they really have the same MAC by default.

Are the MAC addresses in the Broadcom MAC address allocation - I think it starts B8: ?

(a Pi 3 here has B8:27:EB)

I vaguely understood that pre-Pi4 there's no nonvolatile storage on the board to hold the MAC address, so I believe it's generated programmatically in the boot process (from the serial number, I presume). It would seem surprising to have a collision.

The Pi4 has a proper EEPROM holding the boot firmware so there's scope to store the MAC in there - I haven't checked they do that though.

Theo

Am Dienstag, 12. Januar 106, um 10:41:46 Uhr schrieb Theo:

Normally they are assigned to the board manufacturer - regardless of the Ethernet controller that is being used. My Pi 3 also begins with b8:27:eb that is assigned to Raspberry Pi Foundation. The chip is from Microchip Technology, Inc. (formerly SMSC).

I don't know about that at all.

My Zero-W

b8:27:eb:a6:48:7b

Where do network adapters (PCI card or onboard) normally hold their MAC address. I've never heard of two devices happening to have the same MAC address so I assumed that part of the manufacturing process was to allocate a unique, never-to-be-allocated-again address from a pool that the vendor had "bought". Sounds like a problem if RasPi have allocated duplicate MAC addresses. It would make sense for the Pi build process to allocate a serial number and a MAC address which were related, so the Pi 3 calculates it and the Pi 4 reads it from non-vol memory that is set at build time.

What are the implications of duplicate MAC? Is it only a problem within a LAN, or can it be a problem when two devices are on different private LANs (192.168.x.x IP addresses) and the only communication is by different WAN addresses? Is it worse for IPv6 which has no NAT (network address translation) stage?

Normally there is some kind of prom on board. The software reads it but does not have to use it.

Indeed. Why they do not, is unclear.

It's only an issue at the local Ethernet level. As a moments thought would tell you. Internet addresses do not contain the MAC address, It's been stripped out by the boundary router

The MAC is usually burned into the ROM of the internet card.

Yes. I've always set IPs for computers on my LAN by putting its IP in "/etc/hosts" (note that the first two lines wrap):

$ cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.7.5 rpi.gregorie.lan rpi

and I run a local copy of 'named' on my house server, which resolves the names of all computers on my local LAN and passes all other address to external name servers for resolution. This works well, with my Pi2 using the IP I configured it to use.

Am Donnerstag, 14. Juli 2022, um 09:35:08 Uhr schrieb NY:

MAC addresses come from Ethernet and are not related to IP addresses. On an ethernet link (the network with patch cables, Repeaters, Hubs and Switched or even Buses for 10 Base2/5) a MAC address must be unique. A router separates two ethernet links. NAT is relevant here. IPv4/IPv6 also not.

They just have a problem too because packages will not reach their intended destination in a switched network if duplicated MACs exist.

A router just forwards the IP packet. If the other link is also based on ethernet new MAC source and targets will be padded to the IP packet and are a new frame on a separate link.

I'm intrigued: why would you choose to set the IP address statically at the computer (equivalent of doing so with a Windows PC) rather than keeping the default DHCP configuration and letting the address-reservation feature of almost all modern routers take care of the fixed MAC-IP mapping for those devices which need fixed IP addresses?

So *in theory* everybody could use the same set of MAC addresses, as long as no two computers *on the same LAN* shared a MAC address?

I suppose the fact that all network adaptors (apart from Raspberry Pis!) have unique MAC addresses is mainly to avoid MAC address clashes for two computers on the same LAN.

Correct.

They don't- that was the original idea but most if not all manufacturers have been repeating for years and then there are virtual machines. Generally the solution to a clash is either change card or configure a MAC override for the interface.

On a sunny day (Thu, 14 Jul 2022 13:46:29 +0100) it happened "NY" snipped-for-privacy@privacy.invalid wrote in <tap3gl$2ndru$ snipped-for-privacy@dont-email.me:

variable IP addresses is as practical as having everybodies phone number change every day. All computahs on my LAN have fixed IP addresses, very useful if you use scp, netcat, ssh, scripts, etc. You can also set names for each IP address in /etc/host

So the network still works with the router switched off?

I used to do that, and some things like the jailed services still do have fixed IP addresses but most machines (computers, phones, TVs ...) get dynamic addresses and if I'm likely to want to connect to them set a host name which gets picked up by the DHCP server and added to the local DNS so I never need to care what IP gets used.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required