Why MAC Addresses Aren’t Globally Unique—and How to Change Them
This article explains the structure, allocation, and practical use of MAC addresses, why global uniqueness is unnecessary, how to modify them on Linux and macOS, and how they function within LAN communication, including ARP and switch behavior.
MAC (Media Access Control) address is a unique 48‑bit identifier assigned to a network interface controller (NIC). It consists of six bytes, typically written as six pairs of hexadecimal digits, e.g., 6e:77:0f:b8:8b:6b. The first 24 bits form the Organizationally Unique Identifier (OUI) assigned by IEEE to manufacturers, and the remaining 24 bits are a serial number.
IEEE allocates address blocks of three sizes:
MA‑L (Large): 24‑bit OUI + 24‑bit identifier
MA‑M (Medium): 28‑bit OUI + 20‑bit identifier
MA‑S (Small): 36‑bit OUI + 12‑bit identifier
These blocks have different registration costs (e.g., MA‑L costs $2,995, MA‑S costs $755). In practice, global uniqueness is not required because MAC addresses can be changed via software and only need to be unique within a local network.
Modifying the Address
On Linux, the ifconfig command can change a NIC’s MAC address:
$ ifconfig eth0 | grep ether
ether 6e:77:0f:b8:8b:6b txqueuelen 1000 (Ethernet)
$ ifconfig eth0 down
$ ifconfig eth0 hw ether 6e:77:0f:b8:8b:6a
$ ifconfig eth0 up
$ ifconfig eth0 | grep ether
ether 6e:77:0f:b8:8b:6a txqueuelen 1000 (Ethernet)The same approach works on macOS with ifconfig. These changes are temporary and revert after a reboot unless persisted in startup scripts or configuration files.
LAN Communication
Each network adapter has a unique link‑layer (MAC) address used in Ethernet frames. When a device wants to send data, it places the destination MAC address into the frame. Ethernet frames contain source and destination MAC addresses, unlike IP packets which use IP addresses.
To resolve an IP address to a MAC address, devices use ARP (Address Resolution Protocol). The process is:
The source host broadcasts an ARP request to FF-FF-FF-FF-FF-FF.
All hosts check if the requested IP matches their own.
If a host matches, it replies with its MAC address.
The source updates its ARP cache and sends the data.
LANs use hubs or switches. Hubs broadcast frames to all ports, so duplicate MAC addresses cause few issues. Switches learn MAC addresses and forward frames only to the appropriate port; therefore, duplicate MAC addresses in the same LAN cause conflicts.
If two devices share the same MAC address, a switch will learn the address from the first device and may forward traffic back to it, preventing communication with the second device.
Summary
MAC addresses can be altered via software; some manufacturers may reuse or steal address blocks.
Ensuring uniqueness within a LAN is sufficient; identical MACs across different LANs do not cause problems.
Consider these questions:
What is the relationship between MAC and IP addresses?
Why do we need IP addresses if MAC addresses already exist?
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Linux
Focused on sharing Linux/Unix content, covering fundamentals, system development, network programming, automation/operations, cloud computing, and related professional knowledge.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
