Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Dec 1998 17:24:20 -0800 (PST)
From:      Dan Busarow <dan@dpcsys.com>
To:        Lew Payne <lewiz@netcom.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Strange Network Problem
Message-ID:  <Pine.BSF.3.96.981214162705.24918A-100000@java.dpcsys.com>
In-Reply-To: <199812150024.QAA24409@mail.lppi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 14 Dec 1998, Lew Payne wrote:
> On Mon, 14 Dec 1998 15:52:34 -0800 (PST), Dan Busarow wrote:
> > 
> > A more accurate answer would be, make sure that your non-aliased
> > IP address is assigned the correct netmask.  Use 255.255.255.255
> > for all aliased IP's that are within the subnet defined by the
> > real netmask.
> 
> Actually, I use the "correct" netmask even with my aliased IP's.
> If my aliases fall within a Class C, I use 255.255.255.0 netmask.
> 
> I'm intrigued by the responses advising a straight .FF netmask for
> aliases, however.  I've never done it this way.  Can you please
> elaborate as to the logic/advantages?  Is this "by the book?"
> 
> I look forward to learning a new trick...

Stuff below assumes 0xffffff00 is the correct netmask for the network.
s/0xffffff00/your_netmask/g if this is not the case.

When you ifconfig the "real" IP address, eg

ifconfig ed1 192.168.1.1 netmask 0xffffff00

you also setup a static route and create an arp entry.  When you
add the aliased IPs all you need to add are a host route to the new
IP (netmask 0xffffffff) and an arp entry.  An ifconfig like

ifconfig ed1 192.168.1.2 netmask 0xffffffff alias

does that.

If you use a netmask of 0xffffff00 for the alias you get an error
when adding the static route, because it already exists.  Since the
route addition failed the arp entry doesn't get made (I'm guessing here,
I haven't actually confirmed that this is why the arp isn't added.
but I do know that it does not get added).

A netmask of 0xffffff00 "works" for aliases (assuming that's the correct
netmask) but it causes an error message and you can't ping the alias
or telnet to the alias from the host machine unless you manually add 
an arp entry.  You also can't "ifconfig ed1 192.168.1.2 delete" the
alias if it was created with a netmask 0xffffff00 so if you make a
mistake you're stuck with it.

A netmask of 0xffffffff just plain works (as long as the aliased IP falls
within the subnet defined by the netmask on the primary IP).

Use whichever method you prefer.  I prefer the one that has one less step
and doesn't generate an error message :)

Dan
-- 
 Dan Busarow                                                  949 443 4172
 Dana Point Communications, Inc.                            dan@dpcsys.com
 Dana Point, California  83 09 EF 59 E0 11 89 B4   8D 09 DB FD E1 DD 0C 82


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.981214162705.24918A-100000>