On Mon, 2010-11-29 at 14:27 -0800, Peter Taps wrote:
> Folks,
> 
> This is a simple question. Command "ifconfig -a" reports more than one IP 
> address based on the number of NICs. As part of gathering overall system 
> information, if I have to report just one IP address for the system, what 
> would it be? Is there any notion of one IP address being the default one?
> 
> Thank you in advance for your help.
> 
> Regards,
> Peter


If you had to choose one, I'd choose the one that is associated with a
"default" route  (see the output of netstat -r).  However, there could
be systems with either zero, or more than one, such interface.  And the
interface won't necessarily be a physical one if it exists -- it could
be a virtual device of several different flavors.

It may be easiest to just *ask* someone if you need to know such a
thing.  Its best not to design software that is dependent on such a
thing.

(Some software assumes an interface that is associated with the IP
address corresponding to the hostname of the name, but that's not
guaranteed to be correct, and some sites even associate a loopback
address for that.)

        - Garrett


_______________________________________________
networking-discuss mailing list
networking-discuss@opensolaris.org

Reply via email to