How Do Routers Work, Really?
&gt; <i>Note that the next hop’s IP address is in the router’s memory only: it does not appear in the packet at any time.</i><p>This clears some points that always puzzled me:<p>If the gateway is identified by an IP address, but the destination host is also an IP address, which address exactly is put into the packet? And how can a packet be routed if the gateway&#x27;s IP is itself part of the subnet that&#x27;s supposed to be routed to it. (E.g. 192.168.0.0&#x2F;24 with default gateway 192.168.0.1)<p>So the answer is, if I send the packet to host 1.1.1.1 but the routing table has 2.2.2.2 as the next hop, the packet will have 1.1.1.1 as the destination in the IP part but the <i>MAC of 2.2.2.2</i> as destination of the Ethernet part (or equivalent). It doesn&#x27;t matter which subnet the next hop&#x27;s IP is in, as the routing table isn&#x27;t consulted for it anyway - it&#x27;s only used in ARP)<p>This leaves the question, why the indirection and why the mucking around with ARP and IPs that are never used as the destination to anything?<p>Couldn&#x27;t you simply put the next hop&#x27;s MAC address (instead of IP address) into the routing table and be able to route packets just as well, with a lot less complexity?