arp脚本

1.什么是arp?arp可以解决什么问题?

  ARP:是地址解析协议

  arp解决我们知道一个机器(主机或者路由器)的IP地址,需要找出其相应的硬件地址

2.编写ARP脚本,抓取对应主机的mac地址

1 #!/bin/bash
2
3 net='192.168.1.'
4 i=1
5
6 count=0
7 while [ $i -le 254 ]
8 do
9 if [ $count -eq 20 ];then
10 count=0
11 sleep 1
12 fi
13 ping -cl $net$i &
14 let i++
15 let count++
16 done
17
18 wait
19 echo '############################'
20 arp -a|grep -v 'incomplete'
21 echo '############################'
22

安心下来做技术,笑是最大的福气
原文地址:https://www.cnblogs.com/JN-PDD/p/7081046.html