MAC Address vs IP Address
Understand the difference between a MAC address and an IP address, how ARP connects them, and how each is used in delivery.
Expected Interview Answer
A MAC address is a fixed, hardware-burned Layer 2 identifier used to deliver frames within a local network segment, while an IP address is a logical, reassignable Layer 3 identifier used to route packets across different networks all the way to their destination.
A MAC address (e.g., 00:1A:2B:3C:4D:5E) never changes for a given network interface — it is set by the manufacturer and used by switches to forward Ethernet frames to the correct local port. An IP address (e.g., 192.168.1.10) can change whenever a device joins a different network or gets a new DHCP lease, and it is used by routers to figure out the path a packet needs to take across multiple networks, potentially spanning the entire internet. When a packet travels from source to destination, the IP address stays the same for the whole journey while the MAC address changes at every hop, since each router rewrites the frame’s MAC addressing for the next local segment it enters. ARP is the protocol that bridges the two: given a known IP address on the local network, it resolves the corresponding MAC address needed to actually deliver the frame.
- MAC handles local (same-segment) delivery; IP handles end-to-end routing
- IP addresses can change; MAC addresses are stable, hardware-tied identifiers
- MAC address changes at every hop; IP address stays constant end-to-end
- ARP bridges the two layers so both can cooperate in delivering a packet
AI Mentor Explanation
A MAC address is like the serial number engraved on a specific bat by its manufacturer — fixed for life, identifying that one physical bat no matter which ground it is used at. An IP address is like the team and batting order position assigned for a given match, which changes from series to series or even innings to innings depending on selection. A courier delivering equipment between two different stadiums relies on the fixed serial number locally at each ground, but needs the changing team assignment to know which venue to route the parcel to overall.
Step-by-Step Explanation
Step 1
Manufacture
A MAC address is burned into the network interface card at the factory and never changes for that hardware.
Step 2
Assignment
An IP address is assigned to the device by DHCP or statically, and can change whenever it joins a different network.
Step 3
Local delivery
Within one segment, a switch uses the MAC address alone to forward the Ethernet frame to the right port.
Step 4
End-to-end routing
Across multiple networks, routers use the IP address to choose the path, rewriting MAC addressing at every hop.
What Interviewer Expects
- States MAC is Layer 2 / hardware-fixed, IP is Layer 3 / reassignable
- Explains MAC changes per hop while IP stays constant end-to-end
- Knows ARP is the bridge that resolves IP to MAC locally
- Can give the format difference (hex pairs vs dotted decimal / hex groups)
Common Mistakes
- Treating MAC and IP addresses as interchangeable identifiers
- Thinking the MAC address changes as a packet is routed across the internet, not the IP
- Forgetting a device can have one fixed MAC but multiple IP addresses over time
- Not knowing which protocol (ARP) connects the two layers
Best Answer (HR Friendly)
“A MAC address is like your device’s permanent hardware serial number, set at the factory and used to identify it on your local network — say, your home Wi-Fi. An IP address is more like your current mailing address, which can change depending on which network you are connected to, and it is what lets data find its way across the wider internet to reach you. Both work together: IP gets the data to the right neighborhood, and MAC delivers it to the right house.”
Code Example
# Show the MAC address (hardware, fixed) for each interface
ip link show
# eth0: link/ether 00:1a:2b:3c:4d:5e
# Show the IP address (logical, reassignable) for each interface
ip -4 addr show
# eth0: inet 192.168.1.42/24
# See the ARP table mapping local IPs to their MAC addresses
arp -aFollow-up Questions
- How does ARP resolve an IP address to a MAC address?
- Why does the MAC address change at every router hop but the IP does not?
- Can two devices on the same network share a MAC address, and what happens if they do?
- What is MAC spoofing and why might someone use it?
MCQ Practice
1. Which layer does a MAC address operate at?
MAC addresses are Layer 2 (Data Link) identifiers used for local frame delivery.
2. What stays constant as a packet crosses multiple routers?
The IP address stays the same end-to-end; the MAC address is rewritten at every hop for the next local segment.
3. What protocol resolves a known IP address to its MAC address on a LAN?
ARP (Address Resolution Protocol) maps a local IP address to its corresponding MAC address.
Flash Cards
MAC address layer and nature? — Layer 2, fixed hardware identifier burned in by the manufacturer.
IP address layer and nature? — Layer 3, logical identifier that can change (e.g., via DHCP).
What stays the same end-to-end? — The IP address; the MAC address changes at every hop.
What connects MAC and IP? — ARP, which resolves a local IP address to its MAC address.