Mac never leaves the LAN.
The switch in your router knows what to do with your MAC - because that’s hardware level communication.
Even your machine’s IP doesn’t leave your network, your router tracks which interface your IP is on, and keeps a table of local IP:Port mapped to Destination IP:Port on the external interface.
And when you really dig into IP routing, I think the router system actually maps IP to interface, and doesn’t even know about MAC addresses because that’s a layer 2 functionality and routing is layer 3 - so it merely hands a routed packet to the appropriate interface and the switch then maps IP:MAC. But it’s been a long time since I dove into router programming internals.
davad@lemmy.world 3 days ago
You went a layer too low. You can stay at the TCP/IP layer to explain this one. Jumping to MAC addresses is a little like saying “it all depends on how different machines interpret electrical signals.” It’s true, but not particularly helpful.