运维常用的网络工具集锦--arp-scan 网段内设备扫描

说明

arp-scan 用于arp批量扫描. 运维最常见的需求就是分配新ip,确认这个ip有没有被使用.即使有ip表和系统查询,你也不能保证数据的准确性.大部分人会用ping,但是禁ping的服务器再正常不过了. 这个时候就要用到nmap和arp-scan了. 这两个工具安装在同一个子网的服务器内.nmap 用于端口扫描, 可以批量扫描.  arp-scan用于mac地址扫描,可以批量扫描.

        思考一下arp-scan可以做什么, 做子网内设备统计, 做ip冲突检查.在自动化部署中,一般都要核实IP是否在使用, 另外一个也可以做IP检测工具就是nmap

centos6 yum安装arp-scan

centos6的epel源带了这个包,配置好了epel源后可以直接yum安装


wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

yum install arp-scan -y


centos7.6 源码安装arp-scan

yum install autoreconf gcc libpcap* automake -y

git clone https://github.com/royhills/arp-scan.git

cd arp-scan/

autoreconf --install

./configure --prefix=/usr/local/arpscan

make && make install

cd /usr/local/arpscan/bin

#添加到环境变量

echo "export PATH=$PATH:/usr/local/arpscan/bin" >>/etc/profile

source /etc/profile


使用案例(只能同一个子网内扫描)

arp-scan -I ens160 10.10.18.0/24

Interface: ens160, datalink type: EN10MB (Ethernet)

Starting arp-scan 1.9.5 with 256 hosts (https://github.com/royhills/arp-scan)

10.10.18.3      00:50:56:bd:74:cf      VMware, Inc.

10.10.18.4      00:50:56:bd:29:01      VMware, Inc.

10.10.18.5      00:50:56:bd:22:7e      VMware, Inc.

10.10.18.6      00:50:56:bd:cf:09      VMware, Inc.

10.10.18.8      00:50:56:be:e6:04      VMware, Inc.

10.10.18.9      00:50:56:be:91:c0      VMware, Inc.

10.10.18.7      00:50:56:bd:de:c7      VMware, Inc.

你可能感兴趣的:(运维常用的网络工具集锦--arp-scan 网段内设备扫描)