Sub topic 3
Why MAC Addresses Change at Every Router Hop
Assume you know that an IP address identifies a network-layer endpoint, that a MAC address identifies a link-layer interface, and that you can run terminal commands. This chapter focuses on what happens between local networks.
Why MAC addresses change at every router hop
A router removes the incoming Ethernet frame and creates a new frame for the next link. The IP packet inside normally keeps the same source and destination IP addresses. The new frame gets the next router's MAC address as its destination and the router's outgoing-interface MAC address as its source.
A switch forwards frames within one local broadcast domain. A router separates broadcast domains, so a MAC address is meaningful only on its current link. The destination is usually the next hop, not the final host.
Looking at MAC addresses and neighbor tables
Linux exposes interface addresses and recently learned IP-to-MAC mappings:
ip link show
ip neigh showThe neighbor table is local and temporary. An entry can expire, be incomplete, or be absent until traffic causes resolution.
IPv6 Neighbor Discovery replaces ARP
IPv4 uses ARP, the Address Resolution Protocol, to ask, “Who has this IPv4 address?” IPv6 uses Neighbor Discovery (ND), carried in ICMPv6. ND uses solicited-node multicast instead of an Ethernet-wide broadcast request. It also supports router discovery and duplicate-address detection.
MAC randomization and tracking
A factory-assigned MAC often contains an IEEE organizationally unique identifier (OUI), a vendor prefix. Modern Wi-Fi clients may use locally administered, randomized MAC addresses when scanning or joining networks. This limits passive tracking, but it complicates inventory and access-control rules based only on MAC addresses.
> callout note > A MAC address is a link-local identifier, not proof of a person's identity or a device's permanent identity.
MAC spoofing, ARP spoofing, and basic defenses
MAC spoofing changes the address a device presents. ARP spoofing sends false IPv4-to-MAC mappings, potentially redirecting local traffic. Use switch protections such as port security and DHCP snooping with dynamic ARP inspection where appropriate. Prefer authenticated encryption, monitor unusual neighbor changes, and avoid treating MAC allowlists as strong authentication.
Exercise
A packet crosses two routers. Which fields normally change at each hop?
Show answer
The source and destination MAC addresses change for each link. The source and destination IP addresses normally remain the packet's end-to-end addresses.