Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using Solaris 10, and SunStudio. I want to get the Error Message in my Program, when my system IP conflics with another one on the Network. Please reply if some one know the solution.

Thanks INAM

share|improve this question
1  
If your using SunStudio then I guess your programming in C. If you look at the source to arping you should be able to work out how to do it. –  Iain Sep 17 '10 at 10:45
    
Before looking at the source code of arping suggested by lain you should know that it's GPLv2+ licensed. –  Cristian Ciupitu Sep 17 '10 at 19:30

2 Answers 2

you can use arping <ip to check> -i device. If the response is from another mac address as yours, then there is a conflict

share|improve this answer
    
I'm not sure if it's the same on Solaris, but on Linux arping -D ... is used (Duplicate address detection mode (DAD). See RFC2131, 4.4.1.). –  Cristian Ciupitu Sep 17 '10 at 7:48
    
@Cristian Ciupitu: Thanks, did not know this flag ;) On my debian lenny system (arping 2.07~pre1-2) the flag is lowercase –  krissi Sep 17 '10 at 8:24
    
Fedora 13 uses the arping from iputils-20071127-12, not this one which seems to be the one used by Debian Lenny. By the way the exact command used by my ifup-eth script is arping -q -c 2 -w 3 -D -I ${REALDEVICE} ${IPADDR}. –  Cristian Ciupitu Sep 17 '10 at 19:36
    
arping is not bundled with Solaris 10. –  jlliagre Sep 18 '10 at 15:57
1  
Indeed. I didn't wrote it won't work, just it isn't available out of the box. The "you can use" reply would have been better if a link to some place to get the binary, like sunfreeware.com had been provided, which is now done. eg for Solaris 10 on SPARC: ftp.sunfreeware.com/pub/freeware/sparc/10/… & ftp.sunfreeware.com/pub/freeware/sparc/10/… & sunfreeware.com/programlistsparc10.html#libgcc34 –  jlliagre Sep 19 '10 at 22:35

If your question is about detecting if one of your IP addresses is already duplicate, you can look at the system messages (dmesg command output or /var/adm/messages* content) for a log of this type:

Sep 18 17:43:56 m10 ip: [ID 759807 kern.warning] WARNING: iwh0:1 has duplicate address 192.168.001.001 (in use by 00:22:75:12:34:56); disabled
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.