Search code examples
routesipcisco

CCNA IP routing - arp issue


I met a question on the CCNA exam which I got wrong and even though I found it on different websites with a few explanations available, I'm still confused about it.

The question is about what arp entry will a host have in its arp table after a successful ping to a another host on a different router. Now, through all my CCNA studies so far I've always been taught that the IP source and destination addresses do not change in the packet during the routing process, but only the MAC source and destination addresses change. However, the correct answer was indicating that both the IP and MAC addresses of the gateway were present in the arp table of the sending host, and no sign of host B.

This got me confused. And if this is the case, how will the default-gateway router know the destination IP of the other host? It's probably just a tricky question but still... Any clear thoughts on that?


Solution

  • Everything Joe says is correct.

    Having just finished teaching this to a class myself. Let me put this in the terms I used in that class.

    Your question says you have two hosts on two subnets. Let's call the remote host, a server and your local host, well let's stick with local host.

    You local host has an IP address, a subnet mask and a default gateway.

    When you ping the server, your local host uses it's IP address and subnet mask to see if the address being pinged is local or remote. In this case, your server's remote. Knowing this, it knows it has to send the ping to the default gateway. To do that, it has to arp for the default gateway's address. This leaves the entry in the arp table for your default gateway and it's mac address.

    You're correct in thinking that the packet that then leaves your local host to your server has the mac address of the default gateway, but the IP address of the server, but this doesn't effect what's in the arp table.

    Remember, an arp packet asks "Who has?" and provides an IP address. In the network you've described, your default gateway will only respond for it's own IP, not all the IP addresses it can route to.

    Now I could really confuse you here by telling you about the network configurations where this would work differently, but I don't think that would be helpful.

    However it's worth knowing that there are times in the real world when you find things don't work this way. (I'm looking at you NAT and proxy arp).

    I'm not sure this is any clearer than what Joe wrote, but sometimes just hearing a few different explanations help things to click.

    Hope this helps,

    Alex