arping 命令:
说明:arping是用于发送arp请求到一个相邻主机的工具;
arping使用arp数据包,通过ping命令检查设备上的硬件地址。
语法:arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination
参数:

-c count表示发送指定数量的 ARP 请求数据包后就停止。如果制定了deadline选项,则arping会等待相同数量的arp响应包,直到超时为止;

-b 用于发送以太网广播帧(FFFFFFFFFFFF)。arping一开始使用广播地址,在收到响应后就使用unicast地址。
-w timeout设定一个超时时间,单位是秒。如果到了指定时间,arping 还没有完全收到响应则退出;
-q quiet output 不显示任何信息;
-f 表示在收到第一个响应包后就退出;
-s source设定 arping 发送的 arp 数据包中的   SPA 字段的值。如果为空,则按下面处理
如果是 DAD 模式(冲突地址探测),则设置为 0.0.0.0
如果是 Unsolicited ARP 模式(Gratutious ARP)则设置为目标地址;
否则从路由表得出;
-I interface设置ping使用的网络接口;
destination设置目标地址。

===============================================

NAME
       arping - send ARP REQUEST to a neighbour host

SYNOPSIS
       arping [ -AbDfhqUV]  [ -c count]  [ -w deadline]  [ -s source]  -I interface destination

DESCRIPTION
       Ping destination on device interface by ARP packets, using source address source.

OPTIONS
       -A     The same as -U, but ARP REPLY packets used instead of ARP REQUEST.

       -b     Send  only MAC level broadcasts. Normally arping starts from sending broadcast, and switch to uni-cast after reply received.

       -c count
              Stop after sending count ARP REQUEST packets. With deadline option, arping  waits  for  count  ARP
              REPLY packets, until the timeout expires.

       -D     Duplicate  address  detection mode (DAD). See RFC2131, 4.4.1.  Returns 0, if DAD succeeded i.e. no replies are received

       -f     Finish after the first reply confirming that target is alive.

       -I interface
              Name of network device where to send ARP REQUEST packets. This option is required.

       -h     Print help page and exit.

       -q     Quiet output. Nothing is displayed.

       -s source
              IP source address to use in ARP packets.  If this option is absent, source address is:

              · In DAD mode (with option -D) set to 0.0.0.0.

              · In Unsolicited ARP mode (with options -U or -A) set to destination.

              · Otherwise, it is calculated from routing tables.

       -U     Unsolicited ARP mode to update neighbours’ ARP caches.  No replies are expected.

       -V     Print version of the program and exit.
 
       -w deadline
              Specify a timeout, in seconds, before arping exits regardless of how many packets have  been  sent or  received.  In  this case arping does not stop after count packet are sent, it waits either for  deadline expire or until count probes are answered.