Subject: Re: always print IPv4 alias addresses
To: Jason R Thorpe <firstname.lastname@example.org>
From: Christian E . Hopps <email@example.com>
Date: 04/29/2001 09:46:49
On Fri, Apr 27, 2001 at 04:42:44PM -0700, Jason R Thorpe wrote:
> On Sat, Apr 28, 2001 at 08:03:21AM +0900, Jun-ichiro itojun Hagino wrote:
> > currently, IPv4 alias is not printed on the following comand invocation,
> > # ifconfig foo
> > # ifconfig -a foo
> > however, the aliases are there, and will be printed with the following:
> > # ifconfig -A foo
> > # ifconfig -a -A foo
> > it is, IMHO, confusing (and i got comments from others, including
> > jinmei - cc'ed). is it okay to always print aliases, and say
> > good bye to -A? (i.e. -A is the default behavior)
> Sounds good to me. The whole notion of "aliases" seems silly to me,
> really... they're just addresses on an interface. I think the only
> reason we have "alias" is because ifconfig and its ioctls were poorly
> designed in the first place :-)
> (Should have always been "add-address"/"delete-address".)
I agree completely. I recently had to describe "aliases" to a new person at
work and found that the analogy wasn't very illuminating for the person.
Conceptually there are also 2 very different types of "aliases" one that
differ in the host bits and ones that differ in the prefix bits. When you
start talking about interface addresses that differ in the prefix (i.e.,
the interface is on a different layer 3 network), the alias analogy
helps even less.
I ended up saying:
A physical interface can have N layer 3 addresses of which M
are primary addresses (M <= N). A primary address is the address
which will be used as the source IP for self originated packets
that are being sent out the physical interface. There exists
one primary address for each logical network (layer 3 network)
that has been assigned to the physical interface.
In GateD we pick a "primary" address per logical network (i.e., prefix)
and then generate our own IP headers so we can put set the source
IP to the "primary" address. We also allow the user to pick the primary
address by: first from kernel when scanning the addresses (the default),
lowest IP (more deterministic) or explicitly configured.
It might make sense to allow for this type of configuration in NetBSD, or
at least allow for explicit configuration (through an interface flag perhaps).