From owner-freebsd-net@FreeBSD.ORG Mon Apr 24 13:50:40 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org 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 B377016A48F for ; Mon, 24 Apr 2006 13:50:40 +0000 (UTC) (envelope-from erikt@owl.midgard.homeip.net) Received: from pne-smtpout2-sn2.hy.skanova.net (pne-smtpout2-sn2.hy.skanova.net [81.228.8.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id D545443D48 for ; Mon, 24 Apr 2006 13:50:39 +0000 (GMT) (envelope-from erikt@owl.midgard.homeip.net) Received: from falcon.midgard.homeip.net (83.253.29.241) by pne-smtpout2-sn2.hy.skanova.net (7.2.070) id 444497C500180038 for freebsd-net@freebsd.org; Mon, 24 Apr 2006 15:50:39 +0200 Received: (qmail 82265 invoked from network); 24 Apr 2006 15:50:39 +0200 Received: from owl.midgard.homeip.net (10.1.5.7) by falcon.midgard.homeip.net with SMTP; 24 Apr 2006 15:50:39 +0200 Received: (qmail 74523 invoked by uid 1001); 24 Apr 2006 15:50:38 +0200 Date: Mon, 24 Apr 2006 15:50:38 +0200 From: Erik Trulsson To: Ferdinand Goldmann Message-ID: <20060424135038.GA74444@owl.midgard.homeip.net> Mail-Followup-To: Ferdinand Goldmann , freebsd-net@freebsd.org References: <444CD2D0.50800@jku.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <444CD2D0.50800@jku.at> User-Agent: Mutt/1.5.11 Cc: freebsd-net@freebsd.org Subject: Re: How to change order of NICs in FreeBSD? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 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 Apr 2006 13:50:40 -0000 On Mon, Apr 24, 2006 at 03:29:52PM +0200, Ferdinand Goldmann wrote: > Hi there, > > this might be an easy one, but I seem to be unable to come up with a google'd > solution. :( > > I have a machine with four network cards using the em driver: > > em0@pci2:12:0: class=0x020000 card=0x10028086 chip=0x10268086 rev=0x04 hdr=0x00 > em1@pci3:11:0: class=0x020000 card=0x10028086 chip=0x10268086 rev=0x04 hdr=0x00 > em2@pci6:7:0: class=0x020000 card=0x016d1028 chip=0x10768086 rev=0x05 hdr=0x00 > em3@pci7:8:0: class=0x020000 card=0x016d1028 chip=0x10768086 rev=0x05 hdr=0x00 > > Two of the cards are onboard, namely em2 and em3, and the other two (em0, em1) > are sitting in expansion slots. I would like to change the order of the cards, > so that the onboard cards are recognized as em0 and em1. > > I tried using the device.hints file, but without much success. Is there any > way how to do this? > I don't think there is any way to change in what order the kernel detects and configures them, but it is possible to rename the interfaces somewhat later in the boot process. You could try using the 'name' option to ifconfig(8). I believe the syntax is: ifconfig [oldifname] name [newifname] This can also be done via /etc/rc.conf. Read the the section on network_interfaces in the manpage for rc.conf(5) for syntax. You will probably have a minor problem if you wish to rename {em2, em3} to {em0, em1} while at the same time renaming the original {em0,em1} to {em2,em3} but that should be easily resolved using temporary names. -- Erik Trulsson ertr1013@student.uu.se