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.
The cause can also be a smart switch or incorrect assigment of MAC addresses.
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.
Finding a squatter
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..
Which device gets the traffic?
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:
If this page was useful to you, please help others find it:
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)
More Articles by Anthony Lawrence
- Find me on Google+
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Jump to Comments
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.