Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 May 2002 09:12:49 +0200
From:      sthaug@nethelp.no
To:        Gerhard.Sittig@gmx.net
Cc:        stable@freebsd.org
Subject:   Re: 4.6-PRERELASE fxp alias woes
Message-ID:  <15249.1022397169@verdi.nethelp.no>
In-Reply-To: Your message of "Sat, 25 May 2002 21:18:58 %2B0200"
References:  <20020525211858.N1494@shell.gsinet.sittig.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> > >ifconfig_fxp0="inet 216.109.194.4 netmask 255.255.255.0"
> > >ifconfig_fxp0_alias0="inet 216.109.194.8 netmask 255.255.255.0"
> > 
> > As everyone has pointed out, the kernel is now enforcing netmasks on
> > same-subnet aliases.
> > 
> > But I've got a really simple question:  Why, if it is so easy to detect
> > programatically, do we not just *fix* it automagically?  Is there *ever*
> > a case where it is useful to have a same-subnet alias with a different
> > subnet mask (besides the obvious point of it doesn't work with the
> > current code).
> 
> Huh?  I trust a computer to detect _that_ there are collisions.
> But I'd *never* trust the machine to decide _which_ one of
> multiple parameters is the wrong one.

Very simple. Allow the same netmask as the primary address, *and* /32.
Nothing else. Thus

	ifconfig_fxp0="inet 216.109.194.4 netmask 255.255.255.0"
	ifconfig_fxp0_alias0="inet 216.109.194.8 netmask 255.255.255.0"
and
	ifconfig_fxp0="inet 216.109.194.4 netmask 255.255.255.0"
	ifconfig_fxp0_alias0="inet 216.109.194.8 netmask 255.255.255.255"

would both be allowed.

For other subnets (not on the same subnet as the primary address): Let
the first alias decide the netmask, complain if further aliases within
the same subnet (as specified by the alias of the first netmask) use a
different netmask (but allow /32).

There is plenty of prior art here - Cisco routers being the example I
know best. One particular real-life example:

interface FastEthernet0/1/0
 ip address 195.18.218.25 255.255.255.248 secondary
 ip address 195.18.233.193 255.255.255.224 secondary
 ip address 194.19.112.97 255.255.255.224 secondary
 ip address 194.19.112.65 255.255.255.224 secondary
 ip address 194.19.112.225 255.255.255.240 secondary
 ip address 194.19.112.193 255.255.255.224 secondary
 ip address 194.19.112.194 255.255.255.224 secondary
 ip address 194.19.112.33 255.255.255.224 secondary
 ip address 194.19.112.129 255.255.255.224 secondary
 ip address 194.19.112.2 255.255.255.224 secondary
 ip address 194.19.112.1 255.255.255.224

> This would be some kind
> of "no matter what I tell you, do what I mean" or even worse
> "don't take me too serious, do what you think I meant".  This
> is definitely not the UNIX way.  If you wish for this kind of
> features, don't hesitate to install a different OS on your
> machine. :>

As long as it is possible to do this without requiring any kind of
DWIM, I see no problem. And it *is* possible, As Cisco has shown.

Steinar Haug, Nethelp consulting, sthaug@nethelp.no

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15249.1022397169>