Course contents

Unit 4: Ethernet and CablingLesson 4.3 (3 of 11 in this unit)32 of 104 in the Network Fundamentals course

MAC Addresses

Your laptop knows a website's IP address. Why does it still need the router's MAC address before it can send the request? Let's separate the final destination from the next device on the local link.

Beginner · 14 min read · Before this: Ethernet fundamentals, The Ethernet frame

You'll learn to identify the next-hop MAC address for local and remote traffic, read a MAC address without confusing its format with its value, and compare an ARP entry with your active adapter.

Who should receive this frame next?

A laptop sends data through an Ethernet switch. Several devices use that switch, so the outgoing frame needs a destination that identifies its next receiver. A frame is the local-link wrapper around the data. On Ethernet, it contains a source and a destination MAC address.

A MAC address (Media Access Control address) is a 48-bit number that identifies one network interface on a local network. Every Ethernet port and Wi-Fi adapter has one (Bluetooth radios use a similar 48-bit address). It looks like this: 00:00:5e:00:53:2a.

The manufacturer stores it in the interface when it is made, which is why it is also called the burned-in address or physical address. However, software can replace it, and many devices now use a random MAC address instead (see below). A laptop with an Ethernet port and Wi-Fi has two MAC addresses, one for each interface.

The destination MAC identifies the next receiver on this link, which may be a router rather than the final server. A switch can carry the frame between those devices without replacing the source and destination MAC addresses.

Why it exists alongside the IP address

A common beginner question is this: if a computer has an IP address, why does it also need a MAC address? The answer is that the two addresses do different jobs at different layers:

  • The IP address says where the data is finally going, across many networks. It is used for the whole journey.
  • The MAC address says which device on this link should receive the frame next. It is used for one hop at a time.
MAC addressIP address
LayerLayer 2 (Data Link)Layer 3 (Network)
Size48 bits, written as 12 hex digits32 bits (IPv4) or 128 bits (IPv6)
Who sets itThe manufacturer (or the OS, for random MACs)An administrator, a DHCP server, or the device itself (IPv6 SLAAC)
Does it change when you move?Usually not, unless the device uses a random MAC per networkYes: it depends on the network you join
How far it is usedOnly on the local link, up to the next routerEnd to end, across the internet
StructureFlat: shows who made it, not where it isHierarchical: network part + host part

Ethernet can carry traffic other than IP, so it has its own addressing. A basic Layer 2 switch forwards using the destination MAC within a local network. It does not need an IP route for that forwarding. More capable switches can also route and apply security rules. The link between the two is ARP (Address Resolution Protocol), which finds the MAC address that belongs to an IP address on the local network.

Diagram
A new Ethernet frame at the router; the destination IP stays the same
A new Ethernet frame at the router; the destination IP stays the same
Laptop192.168.1.10 · …:aaSwitchHome routerLAN MAC …:01Internet

Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

  • Laptop: 192.168.1.10 · …:aa
  • Home router: LAN MAC …:01
  1. 1. On the LAN: the frame goes from the laptop's MAC address (02:00:00:00:00:aa) to the router's MAC address (02:00:00:00:00:01). The IP packet inside is addressed to 203.0.113.10.
  2. 2. Past the router: the router builds a new frame with its own WAN MAC address as the source. The laptop's MAC address is not carried in frames past the router, but the destination IP address 203.0.113.10 is unchanged.
Figure 1. The laptop sends to the gateway MAC on its LAN. The router builds a new frame towards the remote server.

The laptop is opening a web page at 203.0.113.10, an example server IPv4 address. That number is not a URL. A URL also specifies how to access a resource, such as https://example.com/lesson. Here we already know the destination IP, so name resolution is outside the diagram.

Where MAC addresses are used

  • In Ethernet and Wi-Fi data frames: Ethernet has source and destination fields; Wi-Fi can use additional transmitter and receiver addresses. See the Ethernet frame.
  • In a switch's MAC address table: so the switch knows which port leads to which device (see How a switch learns MAC addresses).
  • In every computer's ARP cache: a list of “this IP address is at this MAC address” for devices on the local network.
  • In DHCP (Dynamic Host Configuration Protocol): a server can recognise a client by a MAC-based identifier or another client identifier; reservation behaviour depends on the server (see DHCP).
  • In Wi-Fi and security rules: MAC filtering, guest portals and network access control.

How a MAC address is built

48 bits are too many to read in binary, so the address is written as 12 hexadecimal digits, in 6 pairs. Each pair is one byte (8 bits). Hexadecimal uses the digits 0–9 and a–f, and each digit stands for 4 bits. The address has two halves:

00
00
5E
00
53
2A
OUI (24 bits): who made the interface
Device-specific (24 bits): assigned by the maker
First octet 00 in binary (bit 7 … bit 0)
0
0
0
0
0
0
0
0
  • Bit 0, I/G: 0 = individual (unicast), 1 = group (multicast/broadcast)
  • Bit 1, U/L: 0 = universally administered (burned in), 1 = locally administered (set by software)
Written as 00:1A:2B:3C:4D:5E, 00-1A-2B-3C-4D-5E, or Cisco-style 001a.2b3c.4d5e. The broadcast address is FF:FF:FF:FF:FF:FF.

Figure 2. A documentation MAC address with the individual/group and universal/local bits shown.

First 24 bits: the OUI

The Organizationally Unique Identifier. The IEEE assigns blocks of addresses to manufacturers (for a fee), and each block has its own OUI. If you look up the OUI, you can see who made the interface.00:00:5e belongs to IANA.

Last 24 bits: the device part

Chosen by the manufacturer, with a different value for every interface it makes. 24 bits give about 16.7 million addresses per OUI, so large manufacturers own many OUIs.

The example 00:00:5e:00:53:2a comes from a block that RFC 9542 reserves for documentation. It is intended for examples, not assignment to deployed devices. This course also uses addresses such as 02:00:00:00:00:aa; you will see below why those are also useful in examples. Locally chosen addresses still need to be unique on a real LAN.

Notation formats

Different systems write the same 48 bits in different ways. They all mean exactly the same address, and upper or lower case does not matter:

StyleSame address
Colons (Linux, macOS, Wireshark)00:00:5e:00:53:2a
Hyphens (Windows)00-00-5E-00-53-2A
Dotted groups of four (Cisco)0000.5e00.532a
No separators (some apps and databases)00005E00532A

The two special bits

Two bits in the first byte have a special meaning. In the diagram above, they are the last two bits of that byte:

Diagram
The two special bits
The two special bits
BitWhen 0When 1
I/G (Individual/Group), the lowest bitUnicast: one interfaceGroup: multicast or broadcast
U/L (Universal/Local), the next bitUniversally administered: assigned by the manufacturer from its OUILocally administered: set by software or by an administrator
Read each row across: the left box names the item, the others describe it.

A quick way to read these bits is to look at the second hex digit of the address:

  • Odd (1, 3, 5, 7, 9, b, d, f): the I/G bit is 1, so it is a group address.
  • 2, 6, a or e: a locally administered unicast address.
  • 0, 4, 8 or c: a normal manufacturer-assigned unicast address.

Unicast, broadcast and multicast MACs

Diagram
Unicast, broadcast and multicast MACs
Unicast, broadcast and multicast MACs
TypeExampleWho accepts it
Unicast02:00:00:00:00:bbOnly the interface with that address
Broadcastff:ff:ff:ff:ff:ff (Cisco: ffff.ffff.ffff)Every device on the LAN
IPv4 multicast01:00:5e:xx:xx:xxDevices that have joined that group
IPv6 multicast33:33:xx:xx:xx:xxDevices that have joined that group
Read each row across: the left box names the item, the others describe it.

The broadcast address is simply all 48 bits set to 1. Multicast addresses have the I/G bit set: 01 in binary is 00000001, so its lowest bit is 1. A source MAC address is never a group address, because a frame always comes from one interface.

01
00
5E
00
00
FB
OUI (24 bits): who made the interface
Device-specific (24 bits): assigned by the maker
First octet 01 in binary (bit 7 … bit 0)
0
0
0
0
0
0
0
1
  • Bit 0, I/G: 0 = individual (unicast), 1 = group (multicast/broadcast)
  • Bit 1, U/L: 0 = universally administered (burned in), 1 = locally administered (set by software)
Written as 00:1A:2B:3C:4D:5E, 00-1A-2B-3C-4D-5E, or Cisco-style 001a.2b3c.4d5e. The broadcast address is FF:FF:FF:FF:FF:FF.

Figure 3. The group bit is set in this multicast address; it is not an individual device address.

This multicast address carries mDNS (multicast DNS), the protocol that printers and smart speakers use to announce themselves on a home network. The rules for building multicast MAC addresses have their own lesson.

Learn more: Unicast, Broadcast and Multicast

How a network card uses its MAC address

When a frame arrives, the network card makes a quick decision before the operating system sees it:

  1. Read the destination MAC address (the first 6 bytes of the frame header).
  2. Is it my own MAC address? Accept the frame.
  3. Is it ff:ff:ff:ff:ff:ff? Accept the frame: broadcasts are for every device.
  4. Is it a multicast group I have joined? Accept the frame.
  5. Anything else: ignore the frame.

A capture tool such as Wireshark can switch the card into promiscuous mode, where it accepts every frame. On a switched network, you still mostly see only your own, broadcast and some multicast traffic, because the switch sends unicast frames only to the right port.

Locally administered addresses and MAC randomisation

Software can replace the burned-in address with an address of its own. To avoid clashing with manufacturers' addresses, it sets the U/L bit to 1, making a locally administered address. The example 02:00:00:00:00:aa is one: 02 is 00000010 in binary, so U/L is 1 and I/G is 0.

02
00
00
00
00
AA
OUI (24 bits): who made the interface
Device-specific (24 bits): assigned by the maker
First octet 02 in binary (bit 7 … bit 0)
0
0
0
0
0
0
1
0
  • Bit 0, I/G: 0 = individual (unicast), 1 = group (multicast/broadcast)
  • Bit 1, U/L: 0 = universally administered (burned in), 1 = locally administered (set by software)
Written as 00:1A:2B:3C:4D:5E, 00-1A-2B-3C-4D-5E, or Cisco-style 001a.2b3c.4d5e. The broadcast address is FF:FF:FF:FF:FF:FF.

Figure 4. The local bit is set. Here the first 24 bits are locally chosen, so the conventional OUI label in the layout does not identify a manufacturer.

You will see locally administered MAC addresses in three places:

Phones and laptops

iOS (“Private Wi-Fi Address”), Android (“Randomised MAC”) and Windows (“Random hardware addresses”) can use a different random MAC address for each Wi-Fi network, so the device cannot easily be tracked from place to place.

Virtual machines

A virtual machine commonly uses a software-provided Ethernet adapter, so the hypervisor or cloud provider assigns its MAC address. Some systems can instead pass through physical hardware. Some (such as KVM) use locally administered addresses; others use the vendor's own OUI.

Manual changes

An administrator can set a MAC address by hand, for example to keep the same address after replacing a network card.

Because MAC addresses can be changed so easily, they are not a strong security control. MAC filtering on Wi-Fi stops casual visitors, but anyone can copy (“spoof”) an allowed address that they have captured from the air.

The hotel Wi-Fi that asks you to log in again

You join a hotel's Wi-Fi with your phone, accept the terms on a login page and start browsing. The next day, you come back and the login page appears again. Why? The hotel remembers devices by MAC address. Your phone used a new random MAC address for that network (after a reset, or simply after some time on some phones), so the hotel saw a “new” device. Turning off the private address for that one network makes the phone keep the same MAC address and stops the repeated logins.

How to find your MAC address

Windows

Example output from a Windows PC, written for this lesson (trimmed)
C:\>ipconfig /all
Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . : home.arpa
   Description . . . . . . . . . . . : Intel(R) Ethernet Connection I219-V
   Physical Address. . . . . . . . . : 00-00-5E-00-53-2A
   DHCP Enabled. . . . . . . . . . . : Yes
   IPv4 Address. . . . . . . . . . . : 192.168.1.10(Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1

Wireless LAN adapter Wi-Fi:

   Media State . . . . . . . . . . . : Media disconnected
   Description . . . . . . . . . . . : Intel(R) Wi-Fi 6 AX201 160MHz
   Physical Address. . . . . . . . . : 02-00-00-00-00-BB
What to look for: each adapter has its own Physical Address, written with hyphens. The Wi-Fi address starts with 02, so it is locally administered (random). getmac /v gives a shorter list.

Linux

Example output from a Linux PC, written for this lesson
$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 00:00:5e:00:53:2a brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DORMANT group default qlen 1000
    link/ether 02:00:00:00:00:bb brd ff:ff:ff:ff:ff:ff permaddr 00:00:5e:00:53:2b
What to look for: link/ether is the MAC address in use, and brd is the broadcast address. On the Wi-Fi card, permaddr shows the burned-in address behind the random one.

macOS

Example output from a Mac, written for this lesson
$ ifconfig en0 | grep ether
	ether 02:00:00:00:00:cc
What to look for: the ether line is the MAC address currently in use. en0 is usually the Wi-Fi interface on a laptop. You can also find the address in System Settings → Wi-Fi → Details. Phones show it in the Wi-Fi settings for the current network.

Other devices' MAC addresses: the ARP cache

Example output from a Windows PC, written for this lesson
C:\>arp -a
Interface: 192.168.1.10 --- 0x7
  Internet Address      Physical Address      Type
  192.168.1.1           02-00-00-00-00-01     dynamic
  192.168.1.20          00-00-5e-00-53-40     dynamic
  192.168.1.255         ff-ff-ff-ff-ff-ff     static
  224.0.0.251           01-00-5e-00-00-fb     static
What to look for: every row pairs an IP address with the MAC address your PC learned for it. dynamic entries were learned with ARP. The broadcast and multicast rows are static: their MAC addresses follow the rules above, so they don't need to be learned.

When MAC addressing goes wrong

Diagram
When MAC addressing goes wrong
When MAC addressing goes wrong
SymptomPossible causeWhat to check
Two devices keep dropping off the network in turnDuplicate MAC address (often a cloned virtual machine)Compare the ip link or ipconfig /all output; give the clone a new MAC address
A device gets a different IP address every time it joins Wi-FiA random MAC address that changes, so DHCP sees a new clientTurn off the private address for that network if you need a reservation
Wi-Fi refuses a device that used to workMAC filtering, with the old burned-in MAC address on the listAdd the device's current (random) MAC address, or disable randomisation for that network
A device can reach some local hosts but not the gatewayWrong or stale ARP entry for the gatewayarp -a; clear it with arp -d * (Windows, as admin)
Read each row across: the left box names the item, the others describe it.

MAC address misconceptions

  • Expecting the MAC address to travel across the internet. It is only used on the local link. The first router builds a new frame with new MAC addresses.
  • Treating MAC filtering as strong security. MAC addresses are sent unencrypted in every frame and are easy to copy.
  • Reading different formats as different addresses. 0000.5e00.532a and 00-00-5E-00-53-2A are the same address, written in Cisco and Windows style.
  • Thinking a device has only one MAC address. Each interface has its own, and Wi-Fi may use a different one on each network.
  • Assuming the OUI always identifies the manufacturer. A locally administered (random) address has no real manufacturer behind it.
MAC address facts to keep
  • A MAC address is a 48-bit Layer 2 address, written as 12 hex digits.
  • In a burned-in address, the first 24 bits are usually the OUI (manufacturer); the rest identify the interface.
  • MAC addresses deliver frames on the local link; IP addresses get packets to their final destination.
  • ff:ff:ff:ff:ff:ff is broadcast; an odd first byte (I/G bit = 1) means a group address.
  • Locally administered (random) MAC addresses have 2, 6, a or e as the second hex digit.

Short lab: identify the next receiver

  1. On your own Windows PC, run ipconfig /all. Record the active adapter's IPv4 address, mask, Physical Address and default gateway. Use your values rather than the documentation addresses in this lesson.
  2. Run ping <your-default-gateway>, replacing the bracketed text with the numeric gateway address. This generates traffic to a device on your local link.
  3. Run arp -a. Look under the active interface for the gateway IP and its MAC. A missing ping reply can reflect filtering as well as a connectivity problem; compare the ARP result with the ping result.
  4. Predict the Ethernet destination for a remote website: it is still the gateway's MAC. The frame gets the packet to the router; the packet's destination IP tells the router where the user wants to go.

These checks read your settings and send a small reachability test. They do not change your adapter configuration.

MAC address quiz

Predict · scenario 1

You find an unknown device in a switch's MAC address table. What can the first half (24 bits) of its burned-in MAC address tell you?

Predict · scenario 2

You see four MAC addresses in a packet capture. Which one is a locally administered unicast address?

Predict · scenario 3

You browse to a website over IPv4. Which of your addresses can the web server see?

Predict · scenario 4

A PC sends an ARP request. The frame's destination MAC address is ff:ff:ff:ff:ff:ff. Which devices on the LAN accept it?

Technical references

The address structure and documentation examples follow RFC 9542. The IPv4-to-Ethernet address mapping follows RFC 826 (ARP). Outputs above are teaching examples, not captured measurements from your computer.

Where to go next

Next, see how switches collect these addresses, how a PC finds a neighbour's MAC address, and what the frame that carries them looks like.

Learn more: How a Switch Learns MAC AddressesARP FundamentalsThe Ethernet Frame

FAQ

Can two devices have the same MAC address?
They should not on the same LAN, and manufacturers work hard to make every burned-in address unique. Duplicates do happen with cloned virtual machines, cheap hardware or manually set addresses. On one LAN, a duplicate confuses the switch and both devices lose traffic. On different LANs, it causes no problem, because MAC addresses are only used locally.
Can a website see my MAC address?
Not from the frames themselves. Your MAC address only travels as far as the first router, usually your home router, and every router builds a new frame with its own MAC address. Websites see your public IP address instead. (Older IPv6 addresses built with EUI-64 contained the MAC address, which is one reason modern systems use random IPv6 interface IDs.)
Why does my phone show a different MAC address on each Wi-Fi network?
Modern phones and laptops use a random, locally administered MAC address for each network, for privacy. This stops shops and public hotspots from tracking the same device everywhere it goes. You can usually turn it off for one network if your router uses MAC-based rules.
Is a MAC address the same as a physical address?
Yes. Windows calls it the “Physical Address”, and you may also see “hardware address”, “Ethernet address” or “burned-in address (BIA)”. They all mean the 48-bit Layer 2 address of an interface.