1

I am a software engineer trying to learn about networking from Ben Eater's video series.

By looking at my wifi connection info, I think I have learned that my router's IP address is 172.20.20.1. (This is the value of the field Default Route).

When I run arp, I get this output.

$ arp 172.20.20.1
Address                  HWtype  HWaddress           Flags Mask  Iface
172.20.20.1              ether   00:00:00:02:02:02   C           wlp1s0

But when I run ifconfig, I get (among other things) this output:

wlp1s0    Link encap:Ethernet  HWaddr e0:94:67:af:28:2d  
          inet addr:172.20.20.20  Bcast:172.20.20.255  Mask:255.255.255.0

Shouldn't the inet addresses match? Why is HwAddress equal to 00:00:00:02:02:02 while the other is e0:94:67:af:28:2d?

Is there a concept I am misunderstanding?

1
  • ARP stands for Address Resolution Protocol, and it is used to resolve layer-3 (e.g. IPv4) addresses to layer-2 (e.g. MAC) addresses so that layer-2 frames can be built for layer-3 packets.
    – Ron Maupin
    Jan 15, 2018 at 15:33

1 Answer 1

4

The default gateway IP address is that of your uplink router, not your local address. Your local IP address appears to be 172.20.20.20 (e0:94:67 indicating an Intel NIC). The local MAC address doesn't appear in the ARP table because nothing will ever be sent there.

ARP is used to send IP packets within local Ethernet frames, so entries in the ARP table will indicate other devices within your local network (the table is a cache, so only recently used devices are listed).

ifconfig shows you the configuration details of your local NICs.

The default gateway's MAC 00:00:00:02:02:02 appears not to be valid. The OUI 00:00:00 belongs to Xerox and has probably been out of use for decades. (Not a problem though, it just needs to be unique within your network.)

2
  • 1
    Ah, I see -- so to rephrase, the arp command is showing me info about my router, while ifconfig is showing me info about myself?
    – Eli Rose
    Jan 15, 2018 at 0:06
  • Pretty much so. The ARP table can hold entries for other, local systems as well, of course.
    – Zac67
    Jan 15, 2018 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.