Understanding MAC Addresses: Structure, Allocation, Modification, and LAN Communication
This article explains the 48‑bit MAC address format, IEEE allocation rules, address block sizes, how to modify MAC addresses on Linux and macOS, and the role of MAC addresses in Ethernet frames, ARP, and LAN communication, highlighting practical considerations and limitations.
MAC (Media Access Control) address is a 48‑bit unique identifier assigned to a network interface controller (NIC), typically displayed as six pairs of hexadecimal digits, e.g., 6e:77:0f:b8:8b:6b .
The IEEE ensures global uniqueness by allocating the first 24 bits as the Organizationally Unique Identifier (OUI) to manufacturers, with the remaining 24 bits serving as a serial number.
Three address block sizes exist: MA‑L (large) with a 24‑bit OUI and 24‑bit host part, MA‑M (medium) with a 28‑bit OUI and 20‑bit host part, and MA‑S (small) with a 36‑bit OUI and 12‑bit host part, each priced differently.
Although global uniqueness is ideal, in practice only LAN‑level uniqueness is required; MAC addresses can be altered via software, and duplicate addresses cause issues mainly when a network uses switches that learn MAC addresses.
On Linux, the MAC address can be changed with ifconfig commands, for example:
$ 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)macOS uses the same ifconfig syntax. These changes are temporary and revert after a reboot unless persisted in configuration files.
In LAN communication, each Ethernet frame carries the source and destination MAC addresses. When a device needs to send data to another, it first resolves the destination IP to a MAC address using ARP, broadcasting a request to FF-FF-FF-FF-FF-FF .
The ARP process involves the source host broadcasting the request, recipients checking the IP, and the matching host replying with its MAC address, after which the source updates its ARP cache and proceeds with data transmission.
Hubs broadcast frames to all ports, so duplicate MAC addresses rarely cause problems, whereas switches learn MAC addresses and forward frames selectively; duplicate MACs on a switch cause the switch to forward frames back to the sender, leading to communication failures.
Key takeaways:
MAC addresses can be spoofed via software; some manufacturers may reuse OUI ranges.
Ensuring uniqueness only within a LAN is sufficient for normal operation.
While global uniqueness is desirable for ease of network management, it is not strictly required.
Further questions include the relationship between MAC and IP addresses and why both are needed in networking.
Sohu Tech Products
A knowledge-sharing platform for Sohu's technology products. As a leading Chinese internet brand with media, video, search, and gaming services and over 700 million users, Sohu continuously drives tech innovation and practice. We’ll share practical insights and tech news here.
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.