局域网通过ip查mac地址、通过mac地址查ip方法

sh-4.1# which arp #linux主机A
/sbin/arp
sh-4.1# arp -a 192.168.1.10 #主机B的IP
bogon (192.168.1.10) at 32:8t:8p:43:43:32 [ether] on br0
h-4.1# ifconfig|egrep "^br0" #主机B
br0       Link encap:Ethernet  HWaddr  32:8T:8P:43:43:32  

通过MAC查IP

sh-4.1# arp -a |egrep "50:9b:6d:15:68:41"
bogon (192.168.1.10) at 50:9b:6d:15:68:41 [ether] on br0
sh-4.1# cat /proc/net/arp|egrep "50:9b:6d:15:68:41"
192.168.1.10     0x1         0x2         50:9b:6d:15:68:41     *        br0

注意MAC里的字母都是 用小写的。其实真正的MAC地址是大写的!!!!

原文地址:https://www.cnblogs.com/bass6/p/5763768.html