From owner-freebsd-stable@FreeBSD.ORG Tue Feb 13 18:55:54 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 CD51416A402 for ; Tue, 13 Feb 2007 18:55:54 +0000 (UTC) (envelope-from fcash@ocis.net) Received: from smtp.sd73.bc.ca (smtp.sd73.bc.ca [142.24.13.140]) by mx1.freebsd.org (Postfix) with ESMTP id ADDE813C49D for ; Tue, 13 Feb 2007 18:55:54 +0000 (UTC) (envelope-from fcash@ocis.net) Received: from localhost (localhost [127.0.0.1]) by localhost.sd73.bc.ca (Postfix) with ESMTP id 6C7391A000B0F for ; Tue, 13 Feb 2007 10:55:53 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at smtp.sd73.bc.ca Received: from smtp.sd73.bc.ca ([127.0.0.1]) by localhost (smtp.sd73.bc.ca [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jeNsVTZSJF0z for ; Tue, 13 Feb 2007 10:55:42 -0800 (PST) Received: from coal (s10.sbo [192.168.0.10]) by smtp.sd73.bc.ca (Postfix) with ESMTP id 08B501A000B0B for ; Tue, 13 Feb 2007 10:55:42 -0800 (PST) From: Freddie Cash To: freebsd-stable@freebsd.org Date: Tue, 13 Feb 2007 10:55:41 -0800 User-Agent: KMail/1.9.5 References: <200702131837.l1DIbHJW010476@lurza.secnetix.de> In-Reply-To: <200702131837.l1DIbHJW010476@lurza.secnetix.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200702131055.41407.fcash@ocis.net> 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 18:55:54 -0000 On Tuesday 13 February 2007 10:37 am, 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. > # 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. 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 don't have access to a test box at the moment (that's at home) to check. > As for outgoing connections: It is true that the kernel > picks a random matching IP address to be the source IP, > which happens to be the first one, but that's just as > coincidence as "-alias" picking the first one if none > is given. ;-) Is it a coincidence, though? 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? My gut tells me it'll be x.x.x.2, but I'll have to check that when I get home. -- Freddie Cash fcash@ocis.net