Detecting Duplicate IP Address using arping

I have been facing a loss of connection suddenly, so I am suspecting that some host on the network is using the same IP address with me.

So I used this tool called arping.

Let’s said I want to check whether 192.168.1.1 is configure on more than 1 host. You need to test it on another machine which is not configure as 192.168.1.1

[svr1:/root]# arping -I eth0 -c 3 192.168.1.1
ARPING 192.168.1.1 from 192.168.1.99 eth0
Unicast reply from 192.168.1.1 [00:0D:A2:02:3B:53] 1.090ms
Unicast reply from 192.168.1.1 [00:0D:A2:02:3B:53] 0.837ms
Unicast reply from 192.168.1.1 [00:0D:A2:02:3B:53] 1.031ms
Sent 3 probes (1 broadcast(s))
Received 3 response(s)

As you can see, the host that response has the same mac address means this IP address is not conflict with any of the host on the network.

To simplify things, you can use this single command that uses “Duplicate address detection mode (DAD)”.

[svr1:/root]# arping -D -I eth0 -c 3 192.168.1.1 >/dev/null;echo $?
1

If you get “0″, it means that the IP address has conflict with another host

    or

it also means that there is no host in the network configured on the IP address.

So I got “1″ on the IP address I am trying to detect, it looks like IP conflict is not a issue here for me.

Hope this helps someone…

Leave a comment