What Is a MAC Address?
A MAC Address (Media Access Control Address) is a unique identifier assigned to a device’s network interface. This includes devices like:
It is used for communication within a local network (like your home or office network).
Think of a MAC address like a physical serial number for your network card. While an IP address can change, a MAC address is usually fixed to the hardware.
Where Does a MAC Address Work?
A MAC address works at Layer 2 (Data Link Layer) of the OSI model.
It is used when devices communicate inside the same local network (LAN). For example:
Before sending data, the device must know the MAC address of the destination device.
MAC Address vs IP Address (Simple Comparison)
+----------------------------+----------------------------------+ | MAC Address | IP Address | +----------------------------+----------------------------------+ | Permanent (usually) | Can change | | Hardware-based | Software/network-based | | Works inside local network | Works across networks (internet) | | 48-bit value | 32-bit (IPv4) or 128-bit (IPv6) | +----------------------------+----------------------------------+
In simple words:
MAC Address Format
A MAC address is:
Example:
00:1A:2B:3C:4D:5E
Or
00-1A-2B-3C-4D-5E
Each pair represents 8 bits (1 byte).
Hexadecimal uses numbers 0–9 and letters A–F.
Structure of a MAC Address
Example:
00:1A:2B:3C:4D:5E
It is divided into two parts:
This ensures no two devices in the world should have the same MAC address.
How MAC Address Is Used (Step-by-Step Example)
Suppose:
It uses ARP (Address Resolution Protocol):
How to Find Your MAC Address
On Windows
Open Command Prompt and type:
ipconfig /all
Look for:
Physical Address . . . . . . . . : 00-1A-2B-3C-4D-5E
ip addr
or
ifconfig
ifconfig
Can a MAC Address Be Changed?
Yes.
Although it is burned into hardware, most operating systems allow MAC spoofing, which means temporarily changing the MAC address in software.
Example (Linux):
sudo ip link set dev eth0 down sudo ip link set dev eth0 address 00:11:22:33:44:55 sudo ip link set dev eth0 up
This changes the MAC address of interface eth0.
Why MAC Addresses Are Important
Network switches use MAC addresses to know where to send data.
How Switches Use MAC Addresses
When a switch receives a frame:
This prevents unnecessary traffic.
Broadcast MAC Address
There is a special MAC address:
FF:FF:FF:FF:FF:FF
This means:
Send to everyone in the network.
ARP requests use broadcast MAC addresses.
Types of MAC Addresses
Important Notes for Beginners
# Windows - View MAC Address
ipconfig /all
# Linux - View MAC Address
ip addr
ifconfig
# macOS - View MAC Address
ifconfig
# Linux - Change MAC Address (MAC Spoofing)
sudo ip link set dev eth0 down
sudo ip link set dev eth0 address 00:11:22:33:44:55
sudo ip link set dev eth0 up