LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-12-2009, 09:33 AM   #1
skiron.liu
Member
 
Registered: Jun 2009
Location: Harbin
Posts: 32

Rep: Reputation: 0
Question How to Detection of IP conflict in Linux


I found out some document that said GNU/linux can't reply Gratuitous ARP request. But I used VMware to do this test.
One is CentOs 5.2(Ubuntu 8.1), another one is Windows xp.
Setup same both ip address.
Start two machines, xp will prompt me IP conflict.
whether linux kernel have fixed it?
if you answer is "yes" then I want to know How to Detection of IP conflict in Linux.
 
Old 07-12-2009, 01:39 PM   #2
Addison0
LQ Newbie
 
Registered: Jul 2009
Posts: 5

Rep: Reputation: 0
I did not understand what do you mean, but web tools may help you detect ip
 
Old 07-13-2009, 02:17 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Hello skiron.liu

When do you want to be notified of the conflict?

The cleanest place to detect the conflict is when a network interface is brought up because it is then that the IP address becomes known. That can happen at any time but, for the majority of systems, happens only at boot. Do you want to halt the boot process and display the error message? That could be inconvenient.

Alternatively, if you mostly work in the graphical environment, you might like the check to be done at login time and any conflict to be displayed in a window.

Best

Charles
 
Old 07-13-2009, 09:01 AM   #4
skiron.liu
Member
 
Registered: Jun 2009
Location: Harbin
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by catkin View Post
Hello skiron.liu

When do you want to be notified of the conflict?

The cleanest place to detect the conflict is when a network interface is brought up because it is then that the IP address becomes known. That can happen at any time but, for the majority of systems, happens only at boot. Do you want to halt the boot process and display the error message? That could be inconvenient.

Alternatively, if you mostly work in the graphical environment, you might like the check to be done at login time and any conflict to be displayed in a window.

Best

Charles
If I only use command line how to detect it? find in /var/log/message? What are keywords that point out conflict?
 
Old 07-13-2009, 09:14 AM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by skiron.liu View Post
If I only use command line how to detect it? find in /var/log/message? What are keywords that point out conflict?
Can't you create a conflict to test and then monitor the logs to see?
 
Old 07-13-2009, 11:20 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Does Linux detect duplicate IPs? I wasn't aware that it does so was thinking of running a script via pre-up in the interfaces file. Wouldn't work for DHCP but that's probably not what skiron.liu is looking for.
 
Old 07-14-2009, 10:28 AM   #7
skiron.liu
Member
 
Registered: Jun 2009
Location: Harbin
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by catkin View Post
Does Linux detect duplicate IPs? I wasn't aware that it does so was thinking of running a script via pre-up in the interfaces file. Wouldn't work for DHCP but that's probably not what skiron.liu is looking for.
My work environment has a lot of embedded linux. all of this use to testing and development. maybe sometimes they set a IP that have been used to another Non-embedded linux server. Then only one device can contact network. At this point, I need a function to detect collision of IP that avoid wasted time to think about why it can't contact other PCs.
 
Old 07-14-2009, 11:01 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Hello skiron.liu

Don't apologise, you're English is fine! Easy to understand. I figure you're thinking clearly so that's a good start

Quote:
Originally Posted by skiron.liu View Post
My work environment has a lot of embedded linux. all of this use to testing and development. maybe sometimes they set a IP that have been used to another Non-embedded linux server. Then only one device can contact network. At this point, I need a function to detect collision of IP that avoid wasted time to think about why it can't contact other PCs.
Unless the embedded Linux systems are acting as servers (so need to have known IP addresses), why not use DHCP? That would solve the problem.

If that's not an option write back and say whether your CentOs 5.2 and Ubuntu 8.1 use the /etc/interfaces to control network interface configuration. That's the only one I'm familiar with.

Best

Charles
 
Old 07-14-2009, 11:16 AM   #9
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Maybe try something like this? I've never tried it.
 
Old 07-14-2009, 12:16 PM   #10
skiron.liu
Member
 
Registered: Jun 2009
Location: Harbin
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by catkin View Post
Hello skiron.liu

Don't apologise, you're English is fine! Easy to understand. I figure you're thinking clearly so that's a good start



Unless the embedded Linux systems are acting as servers (so need to have known IP addresses), why not use DHCP? That would solve the problem.

If that's not an option write back and say whether your CentOs 5.2 and Ubuntu 8.1 use the /etc/interfaces to control network interface configuration. That's the only one I'm familiar with.

Best

Charles
The DHCP seems OK! But actually not.example: DHCP assign a.a.a.a to PC1. but because of some reason that I must manual set IP to my device. Suppose I just be use a.a.a.a then how?

Quote:
Originally Posted by win32sux View Post
Maybe try something like this? I've never tried it.
I have seen this so I have this question about whether reply/request Gratuitous ARP in linux. If "yes", seem kernel isn't log collision. If "no", xp how to detect collision?

Tomorrow I will find two real PC make testing.
 
Old 07-15-2009, 01:28 AM   #11
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Hello skiron.liu

And thanks to win32sux for suggesting IPWatchD It looks like the perfect answer. There's a good explanation at http://ipwatchd.sourceforge.net/ipwatchd-whitepaper.pdf

Best

Charles
 
Old 07-15-2009, 09:36 AM   #12
skiron.liu
Member
 
Registered: Jun 2009
Location: Harbin
Posts: 32

Original Poster
Rep: Reputation: 0
Thanks everyone for help me!
1)ipwatchd is a good daemon. It can send Gratuitous Arp and log collision.
2)other way that can also use "arping -I ethN X.X.X.X"(X.X.X.X is itself of IP), then see output. No collision occured if nothing output. Collision occured if show some MAC address to you.
 
Old 07-15-2009, 10:56 AM   #13
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Hello skiron.liu

Glad you found a solution. Thanks for arping (and sorry I didn't remember it and suggest it earlier).

Please mark thread solved via "Thread tools".

Best

Charles
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an ip conflict detector for linux? vitugv Linux - Networking 3 10-03-2007 03:37 AM
Linux + Windows unseen IP conflict EnigmaPsi Linux - Networking 6 03-11-2007 05:10 AM
Berry Linux 0.76 wget conflict??? clintbrot Fedora 0 11-21-2006 12:57 AM
Linux won't boot--Sound card conflict? blistfix Linux - General 0 01-14-2002 02:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration