From owner-freebsd-stable@FreeBSD.ORG Tue Feb 13 21:32:41 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 C74C716A402 for ; Tue, 13 Feb 2007 21:32:41 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from alnrmhc16.comcast.net (alnrmhc16.comcast.net [204.127.225.96]) by mx1.freebsd.org (Postfix) with ESMTP id A6C1213C441 for ; Tue, 13 Feb 2007 21:32:41 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from icarus.home.lan (failure[71.198.0.135]) by comcast.net (alnrmhc16) with ESMTP id <20070213213239b1600iccpke>; Tue, 13 Feb 2007 21:32:40 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 569DB1FA01D; Tue, 13 Feb 2007 13:32:19 -0800 (PST) Date: Tue, 13 Feb 2007 13:32:19 -0800 From: Jeremy Chadwick To: freebsd-stable@FreeBSD.ORG, fcash@ocis.net Message-ID: <20070213213219.GA72359@icarus.home.lan> Mail-Followup-To: freebsd-stable@FreeBSD.ORG, fcash@ocis.net References: <200702131055.41407.fcash@ocis.net> <200702132036.l1DKaP0f022622@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200702132036.l1DKaP0f022622@lurza.secnetix.de> X-PGP-Key: http://jdc.parodius.com/pubkey.asc User-Agent: Mutt/1.5.13 (2006-08-11) Cc: Subject: Re: Desired behaviour of "ifconfig -alias" X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list 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 21:32:41 -0000 On Tue, Feb 13, 2007 at 09:36:25PM +0100, Oliver Fromme wrote: > > > # 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. Your configuration looks incorrect. How or why it's working is proof that the implementation (read: source code) differs from what some of the docs state. My guess is that it's working because you already have AFAIK, it should be (note alias entries 2,3,4): ifconfig_re0="inet 88.198.44.136 netmask 255.255.255.240" ifconfig_re0_alias0="inet 88.198.173.154 netmask 255.255.255.248" ifconfig_re0_alias1="inet 88.198.173.155 netmask 255.255.255.255" ifconfig_re0_alias2="inet 88.198.173.156 netmask 255.255.255.255" ifconfig_re0_alias3="inet 88.198.173.157 netmask 255.255.255.255" ifconfig_re0_alias4="inet 88.198.173.158 netmask 255.255.255.255" My guess is that it's working because your routing table already has an entry for 88.198.173.154/29 which was created by the first entry. The remaining aliases on that network (88.198.173.154/29) utilise that, but should really have netmasks with all 1s. ifconfig(8) states you should use 255.255.255.255/0xffffffff (all 1s) for IP aliases. The FreeBSD Handbook documents everything I've said quite clearly: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-virtual-hosts.html > 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. As far as I know it's not a hack. If it is/was a hack, can you explain the functional difference between IP aliases with a 0xffffffff netmask vs. mixed-set-bits, and point to some past references stating the difference? -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |