2015-09-25 34 views
0

我正在嘗試從我的wifi網絡上的arp -a掃描中顯示的設備中查找MAC地址。如何從Mac終端中調用「arp -a」的這些結果獲取MAC地址?如何從arp -a掃描中查找MAC地址

? (10.10.40.1) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
us114-appletv.francisparker.org (10.10.40.92) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
03089mac.francisparker.org (10.10.40.236) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
02543mac.francisparker.org (10.10.41.9) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
us113-dwalcott-0.francisparker.org (10.10.41.83) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
meghans-air.francisparker.org (10.10.41.123) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
faiths-mbp-2.francisparker.org (10.10.41.132) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
09150mac.francisparker.org (10.10.41.144) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
02758mac.francisparker.org (10.10.41.219) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
02769mac.francisparker.org (10.10.41.234) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
? (10.10.42.99) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
? (10.10.42.113) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
? (10.10.44.44) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
? (10.10.44.201) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
? (10.10.45.77) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
? (10.10.45.123) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
? (10.10.45.151) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
? (10.10.46.6) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 
? (10.10.46.137) at 0:90:b:2e:bf:ff on en0 ifscope [ethernet] 

謝謝!

回答

1

你的問題有點不清楚; MAC地址清楚地列在上面的輸出中。我假設你的意思是「如何將arp輸出轉換成一個換行符分隔的MAC地址列表?」這只是一個微不足道的cut來獲得第四列。

arp -a | cut -d' ' -f 4 
+0

對不清楚的問題。我仍然想知道爲什麼你的建議的輸出爲每一行提供相同的MAC地址?另外,當我查找自己的MAC地址時,它的格式不同 – pbullard2017

+0

您可能有一臺網絡設備(可能是交換機,也可能是一臺安全設備),它將自身作爲所知道的所有IP的地址返回。看起來這個裝備是由Lanner製造的。 http://www.lannerinc.com我不知道你期望的MAC地址格式。那些看起來很正常。八位字節沒有前導零(有時工具打印前導零,有時它們沒有) –

+0

任何獲得設備MAC的方法,而不是所有設備返回的方法?順帶一提,感謝您的幫助。學習了不少! – pbullard2017

0

嘗試:

arp -n xxx.xxx.xxx.xxx 

例如我合勤路由器的MAC地址:

arp -n 192.168.1.1 

顯示:

? (192.168.1.1)在c8:6c:87:xx:xx:在en0上ifscope [ethernet]