[ARP] How to look up arp table (mac/ip mapping) in Linux

First, we can ping hostname(ip_addr) to add mac/ip mapping into arp table
or use arp command to do so:
> arp -s hostname(ip_addr) MAC_addr

Second, look up arp table:
> arp -n   (I recommend to use "-n" for avoiding DNS lookup. It is faster.)
        Address                  HWtype    HWaddress               Flags Mask            Iface             ether      20:aa:4b:a3:4c:b7            C                     eth4

or there is another way:
> ip ne dev eth4 lladdr 20:aa:4b:a3:4c:b7 REACHABLE


Popular posts from this blog

[Open vSwitch] How to get port statistics from interface in OVS

[JSON] How to use jansson lib to generate JSON data in C

[Quagga] How to compile and install Quagga on Ubuntu 12.04