How to: Detect Duplicate IP Address With arping command under Linux
Q. I run quite large network with different subnets. I'd like to know how can I find out duplicate IP address under Linux / UNIX?
A. You can use arpping command. The arping utility performs an action similar to ping command, but at the Ethernet layer. You can send ARP REQUEST to a neighbor host / computers.
Task: Send ARP request
Let us find out reachability of an IP on the local Ethernet with arping i.e send ARP request 192.168.1.1:
$ sudo arping -I eth0 -c 3 192.168.1.1
Output:
ARPING 192.168.1.1 from 192.168.1.106 ra0 Unicast reply from 192.168.1.1 [00:18:39:6A:C6:8B] 2.232ms Unicast reply from 192.168.1.1 [00:18:39:6A:C6:8B] 1.952ms Sent 3 probes (1 broadcast(s)) Received 3 response(s)
Where,
- -I eth0 : Specify network interface i.e. name of network device where to send ARP REQUEST packets. This option is required.
- -c 3 : Stop after sending 3 ARP REQUEST packets
Task: 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.
$ sudo arping -D -I eth0 -c 2 192.168.1.1
If 192.168.1.1 duplicated you should see zero exit status:
$ echo $?
Always use following syntax for duplicate address detection with arping:
$ sudo arping -D -I <interface-name> -c 2 <IP-ADDRESS-TO-TEST>
$ echo $?
References:
- Ethernet Layer Tools - arping
- arping man page
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Linux / UNIX FAQ:
- What Would Cause a Lot of ARP Broadcasts From One System / Machine
- Router ARP Cache is Not Releasing Linux / UNIX Server IP address
- Mysql remove duplicate data or rows with DISTINCT
- How to determine or retrieve visitor’s IP address using PHP
- Make an exact duplicate of a NTFS filesystem partition under Linux
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Please do not use the comment form to ask for help / question. Ask your question on the excellent Linux tech support forum. Thank you very much for stopping by our site!
Tags: arp request, arping_command, broadcast, exit status, find duplicate ip address, host computers, ip address, network interface, ping command ~ Last updated on: November 23, 2007



November 23rd, 2007 at 10:03 pm
Be aware that there is an arping as part of the iproute2 package, and this arping is present on Red Hat systems when newly installed - and perhaps others.
This version is available from Thomas Habets.
November 24th, 2007 at 8:51 am
David,
thanks for pointing out more information about arping. I believe they follows same syntax.
February 7th, 2008 at 8:32 am
still the problem persists, even after using lan guard software i am able to find out the mac address of the duplicate ip, it makes my network to respond to mail server requests to slow down partially