linux 下查mac

 

sh-4.1# cat /sys/class/net/eth0/address 
4c:cc:6a:23:9a:85
sh-4.1# ifconfig -a |grep 'HWaddr'|awk '{print $5}'
4C:CC:6A:23:9A:85

 查看连接到本机的远端ip的mac地址:

sh-4.1# cat /proc/net/arp 
IP address       HW type     Flags       HW address            Mask     Device
10.100.0.195     0x1         0x2         1c:67:58:f3:af:0f     *        eth0
10.100.0.183     0x1         0x2         52:54:00:38:30:98     *        eth0
10.100.0.235     0x1         0x2         ac:c1:ee:c0:84:97     *        eth0
10.100.0.127     0x1         0x2         74:51:ba:ee:e8:f0     *        eth0
10.100.0.50      0x1         0x2         2c:5b:b8:a7:8c:93     *        eth0

 

posted @ 2016-12-09 15:44  bass  阅读(424)  评论(0编辑  收藏  举报