Re: IP of a connected Mac
Re: IP of a connected Mac
- Subject: Re: IP of a connected Mac
- From: "Peter Sichel" <email@hidden>
- Date: Wed, 22 Jan 2003 14:04:59 -0500
>
It's hard to define the default interface. There really is no such
>
thing. The best that can be done (I think) is to select the interface
>
pointed to by the default route. That may not be the one desired, of
>
course, wherein lies the rub.
>
>
There really needs to be a library layer that translates "the pile of
>
interfaces and assigned network addresses" to a list ordered by some
>
set of criteria. Determining that criteria will take some time and
>
thought. The world of multihoming is a fairly new one for most users,
>
and for most developers.
>
>
Regards,
>
>
Justin
This can be tricky, but there are some decent 90% solutions:
(1) Use the system configuration framework to build a popup list
of interfaces and IP address, and let the user choose one.
(2) Use the system configuration framework to find the first IP
interface listed and get the corresponding IP address.
- There might be more than one.
- You might see a private address if behind a firewall.
(3) Connect to a well known host on the public internet and
retrieve the local protocol address.
- Resolves which one, but still might be a private IP.
(4) Use a dynamic DNS service (such as www.dyndns.org) to lookup
your publicly visible IP address.
- Assumes you have a corresponding dynamic dns account (free)
and dyndns client.
I might support more than one strategy and let the user
choose the one most appropriate to their situation.
- Peter
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.