From owner-freebsd-current@FreeBSD.ORG Tue Apr 16 20:04:47 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5C3777CC; Tue, 16 Apr 2013 20:04:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 18C0E1459; Tue, 16 Apr 2013 20:04:47 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::b037:d3c5:d0df:2e6b] (unknown [IPv6:2001:7b8:3a7:0:b037:d3c5:d0df:2e6b]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 8E5BF5C44; Tue, 16 Apr 2013 22:04:45 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: control of order of inet devices From: Dimitry Andric In-Reply-To: <20130416183618.GG98205@lor.one-eyed-alien.net> Date: Tue, 16 Apr 2013 22:04:38 +0200 Content-Transfer-Encoding: 7bit Message-Id: References: <20130416135621.GE3286@vpn.offrom.nl> <20130416154423.GD98205@lor.one-eyed-alien.net> <20130416183618.GG98205@lor.one-eyed-alien.net> To: Brooks Davis X-Mailer: Apple Mail (2.1503) Cc: Adrian Chadd , freebsd-current@freebsd.org, Willy Offermans , freebsd-hardware@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 20:04:47 -0000 On Apr 16, 2013, at 20:36, Brooks Davis wrote: > On Tue, Apr 16, 2013 at 10:08:00AM -0700, Adrian Chadd wrote: >> Since people keep asking about this; maybe it's time we added a hint >> to the bus code that allows for the unit to be set based on the pci >> bus / slot / etc. > > I don't see how that would address Willy's request. Neither the unit > number or the if_index of an interface effects its order in > getifaddrs() output. > > With modern bus hierarchies, you probably don't want to use the unit > anyway as it loses too much information. Some along the lines of > Fedora's Consistent Network Device Naming would likely be more useful. > That would be fairly easy to implement. I've been using the ifconfig_XXX_name setting in rc.conf for years now, which at works fine, at least for me. E.g.: ifconfig_em0_name="if_ext" ifconfig_em1_name="if_lan" ifconfig_ral0_name="if_wifi" However, if bus enumeration would randomly swap em0 and em1, for example, this would break down. Linux usually just fixes a specific interface name to a hardware address, e.g. /etc/sysconfig/network-scripts/ifcfg-eth0 on a CentOS box has: DEVICE="eth0" BOOTPROTO="dhcp" HWADDR="00:0C:29:65:E4:E3" ...