From owner-freebsd-rc@FreeBSD.ORG Mon Oct 17 21:53:13 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C6AAA16A41F for ; Mon, 17 Oct 2005 21:53:13 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1F0B43D5C for ; Mon, 17 Oct 2005 21:53:09 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j9HLr9vC024900; Mon, 17 Oct 2005 14:53:09 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j9HLr9wf024899; Mon, 17 Oct 2005 14:53:09 -0700 Date: Mon, 17 Oct 2005 14:53:09 -0700 From: Brooks Davis To: Philipp Wuensche Message-ID: <20051017215309.GH15097@odin.ac.hmc.edu> References: <435412F7.2030906@h3q.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <435412F7.2030906@h3q.com> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: freebsd-rc@freebsd.org Subject: Re: alias configuration in rc.conf X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2005 21:53:13 -0000 On Mon, Oct 17, 2005 at 11:09:11PM +0200, Philipp Wuensche wrote: > Hi, > > I don't know if this is the right place, but I created a patch to > /etc/network.subr and /etc/rc.d/netif to add a simpler alias > configuration in rc.conf. > > Using the ifconfig_fxp0_aliasN="" syntax is error prone. If you forget > to number N serially correct, /etc/rc.d/netif does not configure all > aliases to the interface. Other weird things happen if N is not uniqe. > > Configuring a large number of aliases to an interface (e.g. in > jail-hosting systems) fills up the rc.conf very fast, making the > configuration complex. > > With the patches, alias configuration gets a lot easier. At the moment I > use the ipv4_ifconfig variable, its not jet used. Mayby something else > would be better. Using ranges in the last byte of the ipaddr. allows to > configure more than one ipaddr in one statement. > > The syntax is as follow: > > ipv4_ifconfig_fxp0="192.168.0.1/24 23.23.23.5-23/24" > > This will configure fxp0 with the alias 192.168.0.1/24, 23.23.23.5/24 > and 23.23.23.6-23/32 > > You can find the patch at > http://outpost.h3q.com/patches/network.subr-range.patch > > Comments and testreports are very welcome :-) Nice idea! The aliasN stuff is ugly. Some comments: I don't like ipv4_ifconfig_fxp0. I'd suggest ifconfig_fxp0_ipv4_aliases instead. The ipv4_ifconfig_getargs function is slightly bogus as written since a default value makes no sense and that would be the wrong one anyway. The implemenation also fails to match the comment though that's easy to fix. I'd also not modify etc/rc.d/netif and do this from ifalias_up(). Corresponding ifalias_down() support should also be added. Finally modifications will be needed to rc.conf(5). -- Brooks