(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version



Dealing with Duplicate IP addresses


2009/04/04

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.

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:

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)



;



;


Click here to add your comments





Sat Apr 4 14:51:59 2009: Subject:   TonyLawrence

gravatar
I forget to mention that some smart switches can show what is in use on each port. It probably will only show MAC addresses, but you can use arp to convert that back and at least find the right wire.





Mon Apr 6 21:48:01 2009: Subject:   TonyLawrence

gravatar
A customer mentions that he uses



arping -D -I eth0 192.168.1.10; echo $?



Mon Apr 6 21:54:28 2009: Subject:   TonyLawrence

gravatar
Also someone asked HOW you hard code the arp cache. It's just

arp -s hostname_or_ip mac_address pub



Thu Apr 30 03:55:36 2009: Subject:   Andreas

gravatar
Helo,
i have a question:
in Windows, if someone is trying to use same IP adress (if i connected first and another user enters it in hes TCP/IP config), i can see warning about duplicate IP.
Mac OS X 10.5.6 has some warning also, or just stays online and i cant even know if someone (eg. some angry neigbour) is trying to steal my IP?
And if its unable to get any warning, can You recommend some software for monitoring it?
Thanks



Thu Apr 30 11:53:08 2009: Subject:   TonyLawrence

gravatar
Angry neighbor?

You are confused about something. Unless your neighbor is hacking into your network, it doesn't matter what they use - nothing to do with you.

Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar


ad


numly esn 90300-090404-743907-90
numly barcode

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

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.

Publishing your articles here

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.


book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!



 I sell and support
 Kerio Mail server




pavatar.jpg
More:
       - Microsoft
       - MacOSX
       - Linux
       - Networking
       - Troubleshooting


Unix/Linux Consultants

Skills Tests

Guest Post Here











My Favorites

Change Congress