From owner-freebsd-net@FreeBSD.ORG Mon May 24 06:52:51 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F2DBB16A4CE for ; Mon, 24 May 2004 06:52:50 -0700 (PDT) Received: from whizzo.transsys.com (whizzo.TransSys.COM [144.202.42.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 97E0543D3F for ; Mon, 24 May 2004 06:52:50 -0700 (PDT) (envelope-from louie@transsys.com) Received: from whizzo.transsys.com (localhost [127.0.0.1]) by whizzo.transsys.com (Postfix) with ESMTP id 2BF7320F6C; Mon, 24 May 2004 09:51:47 -0400 (EDT) X-Mailer: exmh version 2.6.3 04/04/2003 with nmh-1.0.4 To: Alex Semenyaka Organization: Serendipity Scheduling & Management X-Image-URL: http://www.transsys.com/louie/images/louie-mail.jpg From: "Louis A. Mamakos" References: <20040520162919.GA1971@straylight.m.ringlet.net> <20040520171833.GA22494@Odin.AC.HMC.Edu> <20040521133530.GA1403@qqmore.rinet.ru> <20040523233737.219F720FC5@whizzo.transsys.com> <20040524034049.GA1022@qqmore.rinet.ru> In-reply-to: Your message of "Mon, 24 May 2004 07:40:49 +0400." <20040524034049.GA1022@qqmore.rinet.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 24 May 2004 09:51:47 -0400 Sender: louie@transsys.com Message-Id: <20040524135147.2BF7320F6C@whizzo.transsys.com> cc: freebsd-net@freebsd.org cc: Peter Pentchev Subject: Re: [RFC] ifconfig: match by link-level address X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2004 13:52:51 -0000 > On Sun, May 23, 2004 at 07:37:37PM -0400, Louis A. Mamakos wrote: > > >>> This could be the first step towards teaching rc.conf about something like > > >>> network_interfaces_rename="hw-00:03:0d:08:dc:a7 sis0int" > > >> I don't really like the idea of adding magic values to the interface > > >> namespace that only work with ifconfig. If you want ifconfig to match > >> I agree, but there is another option: make such things not ifconfig-specific. > >> I mean that it could be done though renaming the interface into the some > >> lladdr-dependent name with fixed format. For example, > > This is all pretty interesting, though it seems like you'd only > > need to cobble together a shell script to do what you're after. > > You've absolutely right and I wanted to propose it just on the base of > currently existing functionality (independently of this thread). However if > there will be automatic renaming things would be easier. Thus I decided to > combine both approaches since it leads to simple solution. > > I would post my current changes (those giving the discussing functionality) to > the startup scripts as PR and send here the number. I'll do it if anybody will > express any interest in that. Actually those scripts could be changed in future > if ``ifconfig'' will provide such possibility out-of-box, and changes will be > seamless for users. This interface renaming operation is likely to only occur as the system boots, and probably is an "automated" process rather than one that involves human. Keeping with the decades-long UNIX tradition of using combinations of tools would lead you to writing a simple shell script, rather than going to all the trouble to extend the existing tool. Certainly there's no performance-related reason to do so. I guess I don't see how you might choose to extend ifconfig to implement some function that can't be done with some external tools. About the only ifconfig capability you need is a way to discover the link-level address (and hopefull media type), and a way to cause the renaming operation to occur. I'm not sure how much easier "automatic" renaming might be. You still need some ability to specify policy on what interfaces are renamed (e.g., only 100Base-T ethernet but not 802.11 wireless). Once you've opened that can of worms, doing the actual renaming is likely the easy part of the problem. There's already a bunch of code that iterates over network interface in /etc/rc.network (on 4-STABLE anyway). In the end, it's a matter of taste and opinion. louie