How to: Detect Duplicate IP Address With arping command under Linux

Send ARP request

Let us find out reachability of an IP on the local Ethernet with arping i.e send ARP request 10.0.0.44:

$ arping -I bond0 -c 2 10.0.0.44   
ARPING 10.0.0.44 from 10.0.0.43 bond0
Unicast reply from 10.0.0.44 [00:1F:29:56:2D:B1]  0.685ms

Where,
◾-I eth0 : Specify network interface i.e. name of network device where to send ARP REQUEST packets. This option is required.
◾-c 2: Stop after sending 2ARP REQUEST packets

Find duplicate IP

The -D option specifies duplicate address detection mode (DAD). It returns exit status 0, if DAD succeeded i.e. no replies are received.

$ arping -D -I bond0 -c 2 10.0.0.44
ARPING 10.0.0.44 from 0.0.0.0 bond0
Unicast reply from 10.0.0.44 [00:1F:29:56:2D:B1] for 10.0.0.44 [00:1F:29:56:2D:B1] 0.689ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)

If 192.168.1.1 duplicated you should see zero exit status:

$ echo $?
1
This entry was posted in Linux. Bookmark the permalink.