如何从arp -a扫描中查找MAC地址

时间:2015-09-25 17:15:00

标签: macos

我正在尝试从我的wifi网络上的arp -a扫描中显示的设备中查找MAC地址。如何从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]

谢谢!

2 个答案:

答案 0 :(得分:1)

你的问题有点不清楚; MAC地址清楚地列在上面的输出中。我假设你的意思是“如何将arp输出转换为换行符分隔的MAC地址列表?”获得第四列只是一个微不足道的cut

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

答案 1 :(得分:0)

尝试:

arp -n xxx.xxx.xxx.xxx

e.g。我的Zyxel路由器MAC地址:

arp -n 192.168.1.1

所示:

? (192.168.1.1)at c8:6c:87:xx:xx:xx on en0 ifscope [ethernet]

相关问题