← 返回命令列表

Linux command

arping 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Ping a host using ARP

sudo arping [192.168.1.1]

Ping using a specific interface

sudo arping -I [eth0] [192.168.1.1]

Send a specific number of requests

sudo arping -c [5] [192.168.1.1]

Detect duplicate IP addresses on the network

sudo arping -D [192.168.1.1]

Quit after first reply

sudo arping -f [192.168.1.1]

说明

arping sends ARP requests to a target host and displays responses. Unlike ICMP ping, ARP operates at layer 2 and cannot be blocked by IP firewalls. The tool is useful for verifying layer 2 connectivity, finding MAC addresses, and detecting duplicate IP addresses on a network.

参数

-c _count_
Stop after sending _count_ ARP REQUEST packets.
-I _interface_
Network interface to send ARP requests on.
-D
Duplicate address detection mode (DAD). See RFC 2131.
-A
ARP reply mode (gratuitous ARP reply).
-U
Unsolicited ARP mode to update neighbours' ARP caches. No replies are expected.
-b
Send only MAC-level broadcasts; do not switch to unicast after reply.
-q
Quiet mode; nothing is displayed.
-s _source_
Source IP address to use in ARP packets.
-w _deadline_
Timeout in seconds before exiting regardless of packets sent or received.
-i _interval_
Interval in seconds between packets.
-f
Quit after the first reply confirming target is alive.
-V
Print version and exit.

FAQ

What is the arping command used for?

arping sends ARP requests to a target host and displays responses. Unlike ICMP ping, ARP operates at layer 2 and cannot be blocked by IP firewalls. The tool is useful for verifying layer 2 connectivity, finding MAC addresses, and detecting duplicate IP addresses on a network.

How do I run a basic arping example?

Run `sudo arping [192.168.1.1]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c _count_ do in arping?

Stop after sending _count_ ARP REQUEST packets.