Re: Is there a clean way to get my default IP address.
Re: Is there a clean way to get my default IP address.
- Subject: Re: Is there a clean way to get my default IP address.
- From: "Peter Sichel" <email@hidden>
- Date: Wed, 7 Dec 2005 15:07:40 -0500
On 12/6/05, Frederick Cheung wrote:
>> Is that like the "en0" and "en1" you see in the "ifconfig" output?
>> Is that what you mean by "Interface".
>>
>Yup, that's an interface
In my humble opinion, the BSD stack itself is a little confused about
this since each such interface like "en0" can have a list of IP
addresses it responds to which means it could be more than one
interface. I wrote the text below to explain this to IPNetRouterX
customers...
What Is An IP Interface?
------------------------
The concept of a network interface can be confusing to people new to
networking terminology so it may help to clarify exactly what we mean by
this. When we talk about "PPP over Ethernet" (PPPoE) for example, is
this a PPP interface or an Ethernet interface? [Answer: it's a PPP
interface typically identified as "ppp0" to the IP routing layer.]
From outside the computer, a network interface may appear to be the
Ethernet jack or internal modem, but these are more accurately described
as network ports or devices. Within the computer, an IP interface is a
data structure specifying various interface attributes like its IP
address and mask and some code for handling messages associated with
that structure. Thus a single port can have more than one IP interface.
What's significant is that an interface defines a protocol, a set of
messages that we're interested in, and some code for processing them. In
practical systems, parts of the data structure that defines an IP
interface may be implemented in more than one place. Some in the IP
layer of the BSD stack, some in the Network Preferences Panel (System
Configuration Framework), and some in Extensions that provide other
services such as IP filtering, Network Address Translation, PPP (Point-
to-Point Prococol), or secure communcation using PPTP or IPSec.
Within Mac OS X, the part of the IP interface data structure defined in
the IP layer of the BSD stack is identified by a device name (such as
"en0" or "ppp0") while the part defined in the System Configuration
framework is identified by a Service ID (a so called UUID or Universal
Unique Identifier such as: "FF414B0D-87ED-11D8-B1D9-000A95EEE352").
Since these UUIDs are machine specific and rather long, IPNetRouterX
adopts a notation used by other UNIX systems of identifying additional
IP interfaces on the same physical port by appending an index as in
"en0:1" to to form a unique Interface ID. In this example "en0:1"
indicates the second IP interface on en0 with the first interface being
"en0:0" (which is abbreviated as just "en0"). Internally IPNetRouterX
uses the corresponding device name or UUID as needed for communicating
with other system components. The purpose of these "Interface IDs" is
simply to correllate the separate pieces of the IP interface data
structure wherever they appear.
The Network Preferences Panel also provides a "User Name" for each
network service, but at the time of this writing, these User Names are
not available to 3rd party applications like IPNetRouterX. IPNetRouterX
displays the Interface Name as the Port Name followed by the Device Name
in parentheses (both of which you can edit) and a unique Interface ID as
described above. By convention, "en0" (Ethernet 0) is used for Ethernet
Built-in, while "en1" is used for AirPort or the first PCI Ethernet card
if there is one. "ppp0" is used for the first PPP device which could be
associated with a modem or PPPoE. "lo0" refers to the loopback interface
used for interprocess communication.
Since Apple is free to enhance the IP interface data structure as
defined in the Network Preferences Panel (System Configuration
Framework), the Interface panel in IPNetRouterX does not try to emulate
or replace the Network Preferences Panel, but rather works along side it
to provide additional interface attributes.
If you change locations in the Network Preferences Panel, IPNetRouterX
may interpret new interfaces as ones being added to the previous
configuration and assign them new InterfaceIDs. To have IPNetRouterX
rescan the entire list of available interfaces, press the "Refresh List"
button.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden