From owner-freebsd-stable@FreeBSD.ORG Tue Feb 13 20:36:33 2007 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3162C16A402 for ; Tue, 13 Feb 2007 20:36:33 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id A744013C48E for ; Tue, 13 Feb 2007 20:36:32 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (qtedgn@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id l1DKaQ2e022623; Tue, 13 Feb 2007 21:36:31 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id l1DKaP0f022622; Tue, 13 Feb 2007 21:36:25 +0100 (CET) (envelope-from olli) Date: Tue, 13 Feb 2007 21:36:25 +0100 (CET) Message-Id: <200702132036.l1DKaP0f022622@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, fcash@ocis.net In-Reply-To: <200702131055.41407.fcash@ocis.net> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 13 Feb 2007 21:36:31 +0100 (CET) Cc: Subject: Re: Desired behaviour of "ifconfig -alias" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, fcash@ocis.net List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2007 20:36:33 -0000 Freddie Cash wrote: > Oliver Fromme wrote: > > Freddie Cash wrote: > > > For a set of IPs in the same subnet on the same interface, wouldn't > > > the primary IP be the one with the proper netmask, and all IPs with > > > netmasks of /32 be secondary? > > > > That's historic. :-) Old versions of FreeBSD indeed > > required the netmask of the "aliases" to be /32 in that > > case. But it's no longer the case. > > Hmmm, if this is the case, then the man page for ifconfig(8) is > out-of-date wrt this as well: > > alias Establish an additional network address for this interface. This > is sometimes useful when changing network numbers, and one wishes > to accept packets addressed to the old interface. If the address > is on the same subnet as the first network address for this > interface, a non-conflicting netmask must be given. Usually > 0xffffffff is most appropriate. Well, yes, the ifconfig(8) manual page is lacking in several aspects, it seems. > > # ifconfig re0 > > re0: flags=8843 mtu 1500 > > options=1b > > inet 88.198.44.136 netmask 0xffffffe0 broadcast 88.198.44.159 > > inet 88.198.173.154 netmask 0xfffffff8 broadcast 88.198.173.159 > > inet 88.198.173.155 netmask 0xfffffff8 broadcast 88.198.173.159 > > inet 88.198.173.156 netmask 0xfffffff8 broadcast 88.198.173.159 > > inet 88.198.173.157 netmask 0xfffffff8 broadcast 88.198.173.159 > > inet 88.198.173.158 netmask 0xfffffff8 broadcast 88.198.173.159 > > > > > In that situation, wouldn't deleting the primary IP > > > cause connection issues for the rest of the IPs? > > > > No. I can delete _any_ of the above IP addresses, and the > > others would still work perfectly fine. I already did > > things like that (on a different machine). > > Yes, but each of the IPs is on their own subnet. No, please look closer. The addresses above are all in the same subnet (except for the first one). It's a /29 subnet in this case, but it works exactly the same with /24 or any other subnet masks. > I'm talking about a > situation where one IP on the interface has a /24 netmask, and all the > other IPs on the interface have /32 netmasks. Would removing the IP with > a /24 netmask cause connection issues for the other IPs on that > interface? I'm not sure. I think they should just continue to work, but I would have to try that. But why would you want to use /32 netmasks? That was just a hack for the historic limitation that you couldn't use real netmasks for IPs within the same subnet. There's no reason to use that hack anymore. > If you add the following IPs to an interface: > x.x.x.2/24 > x.x.x.3/32 > x.x.x.4/32 > x.x.x.5/32 > Then remove x.x.x.2, and re-add it as x.x.x.2/24 so it appears at the > bottom of the list of IPs, what IP is used for outgoing connections? As I said, I would have to try that because I haven't used the /32 netmask hack for quite some time. I think it would indeed use the first address, i.e. x.x.x.2. > My gut tells me it'll be x.x.x.2, but I'll have to check that when I get > home. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart Any opinions expressed in this message are personal to the author and may not necessarily reflect the opinions of secnetix GmbH & Co KG in any way. FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd $ dd if=/dev/urandom of=test.pl count=1 $ file test.pl test.pl: perl script text executable