Duplicate IP's on a network is an interesting problem that has no completely satisfactory solution, especially when malicious intent is involved. Let's leave those intentional conditions for another day; here we'll look at what happens when an IP gets duped accidentally.
The "accident" can be from a human assignment of a static ip that was already in use. It can come from setting up two DHCP servers with overlapping ranges. It can come from a machine that legally obtained a DHCP address at some time in the past but has been shut off for sometime since then and that IP has been reused for some more active machine.
Whatever the reason, there is the very important question of how this affects other machines on the network. Ideally, a machine that starts up with an address already in use elsewhere should notice that and shut its network down. Unfortunately, not all network software is so friendly and polite.
However, being polite can be frustrating if the machine demurring to use an address is the machine that is supposed to have that ip. Maybe it's a server or printer that was down for maintenance and upon its return to the live network some squatter has stolen what used to belong to it.
In that case, you need to track down and nullify the impersonator before you can get the rightful device back in service. One way is to look at its MAC address as shown in the arp cache. If you are really lucky, looking up that MAC will point to something that you can easily identify. If not, "nbtstat" (Windows) or "nmblookup" (Samba) could give you a machine name. If it doesn't, or if machines are named in the haphazard fashion most typically done, your best option (assuming you don't have a smart switch that can help) is to start unplugging things at the switch to track it down - when the ping stops, you've found the wire. Start by disconnecting whole switches to isolate where it is and then zero in on it. Unfortunately, in places that never bothered to number jacks, you may still find yourself running around with a probe even after you have found one end of the wire. At least you know you can ignore the folks still browsing the Internet..
Speaking of finding the offending machine: I've seen a Windows server get confused by itself. That is, for some reason it sometimes thought it was seeing its own self on the network and would complain about the "duplicate" IP. I think this happened because of a name change, but I never did get to the bottom of it and a new server replaced it soon after..
If neither OS is willing to play nice and not use the IP in conflict, the question then becomes which of these two devices will be seen by the rest of the network? A machine that has previously cached the MAC address of one of the devices will continue to talk to that, but otherwise its a coin flip: who answered the arp request first?
That leads to one way to prevent IP confusion: hard code the arp cache for machines that simply must not be confused. If you have a client box that has a really critical need to talk to ServerOne at its ordained IP address, hard coding the arp cache on the client with the server's MAC address will keep it faithful - well, at least from most accidental impersonations. Something still could spoof the MAC, but that's usually going to be purposeful rather than accidental.
That hard coding of the MAC can also be done at an intelligent switch. Some switches allow port-ip binding - locking an ip to a specific port on the switch. Doing both of those things would go a long way to ensuring that packets are going to the right device, but of course would also make your network harder to maintain. No more just plug and play, there'd be procedures and paperwork for that. The extra trouble might be well worth it in some scenarios but nothing and an annoyance in others.
In some situations you might need to bring together whole networks with overlapping IP's - that's a job for a NAT router.
You can't really prevent duplicate IP's. You can detect duplicates, block them, perhaps even mask them, but there's always a price to pay somewhere.
Some links you might find useful:
Mysterious Duplicate IP problem solved
New Dell machine kills server
Detection of duplicate IP addresses by Microsoft TCP/IP
How to Troubleshoot Duplicate Media Access Control Address Conflicts
Configure Port-IP Binding
Use DHCP Snooping and ARP Security to Block ARP Poisoning Attacks
Layer 2, Mac Addresses, ARP, and Duplicate IP Detection (Linux Kernel Patch)
If you found something useful today, please consider a small donation.
Got something to add? Send me email.
More Articles by Anthony Lawrence © 2011-11-13 Anthony Lawrence
If Linux can skate by the patent and copyright issues, its growth in the corporate world will continue no matter what business dislikes about the GPL. (Tony Lawrence)