在 Ubuntu 14.04 LTS Server 上安裝 arp-scan 工具
# apt-get install arp-scan
在 CentOS 6.x 上安裝
# yum install arp-scan –enablerepo=epel
利用 arp-scan 進行偵測
# arp-scan –localnet
Interface: eth0, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.1.2 ac:22:0b:50:49:ea (Unknown)
192.168.1.5 00:1d:7d:c5:2f:d3 GIGA-BYTE TECHNOLOGY CO.,LTD.
192.168.1.100 00:11:23:0c:da:e2 Synology Incorporated
192.168.1.101 28:cf:e9:80:0c:76 (Unknown)
192.168.1.112 00:0c:29:ac:47:64 VMware, Inc.
192.168.1.254 50:67:fa:19:cf:a4 ZyXEL Communications Corporation
9 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.8.1: 256 hosts scanned in 2.316 seconds (110.54 hosts/sec). 7 responded[@more@]利用 sed / egrep 來過濾一些不要的資料,和使用 awk 來取得所要的資料
# arp-scan –localnet | sed -n ‘/Starting/,/^$/p’ | egrep -v ‘(Starting|^$)’ | awk ‘{print $1,$2}’
192.168.1.2 ac:22:0b:50:49:ea
192.168.1.5 00:1d:7d:c5:2f:d3
192.168.1.100 00:11:23:0c:da:e2
192.168.1.101 28:cf:e9:80:0c:76
192.168.1.112 00:0c:29:ac:47:64
192.168.1.254 50:67:fa:19:cf:a4