From owner-freebsd-questions@FreeBSD.ORG Thu Jan 15 09:26:36 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77E3F106566B; Thu, 15 Jan 2009 09:26:36 +0000 (UTC) (envelope-from yonyossef.lists@gmail.com) Received: from mail-ew0-f30.google.com (mail-ew0-f30.google.com [209.85.219.30]) by mx1.freebsd.org (Postfix) with ESMTP id 97ED58FC1D; Thu, 15 Jan 2009 09:26:35 +0000 (UTC) (envelope-from yonyossef.lists@gmail.com) Received: by ewy11 with SMTP id 11so332105ewy.19 for ; Thu, 15 Jan 2009 01:26:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:references:subject :date:message-id:mime-version:content-type:content-transfer-encoding :x-mailer:thread-index:x-mimeole:in-reply-to; bh=lWhGXq89Xm6/iBLbSj+8fH+b7Da78Dz3MGjgAjfu868=; b=ACiFOyxmvOSy7+EGx8ZHiaXr1aKoC2mPRQZGJorDbEM9fZGUoqxZAil0RUYc6oarvT Tp6JrllIwOLS4E+hY923fpQaEUbJ5nJ9rHmtCMoBYP++pNzX3ckni6VzQdpLAUZUz/6R PESgdwGNqtx5aa6vA7WESDZDeFFjBQR+7FiuQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:references:subject:date:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :x-mimeole:in-reply-to; b=HRbRenjh8gS/dh9PkVnpKkvC1kc5qapYvEKnYOQeRlioQRedO3/nDKCtgC+b9Zcikz FuRZTwfEmEqRRDdvqyJ5LAiazBSRCCXREmZ4WGZFd3U2sDh7O6HfPOJ8RGIsucIEYx+2 TwmJSHCr42MTLGkVAmeRjq2rgmiRqk0cgEmoQ= Received: by 10.67.116.7 with SMTP id t7mr3099084ugm.63.1232011593830; Thu, 15 Jan 2009 01:26:33 -0800 (PST) Received: from mtllpt03 (DSL212-235-20-133.bb.netvision.net.il [212.235.20.133]) by mx.google.com with ESMTPS id o30sm1259739ugd.35.2009.01.15.01.26.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 15 Jan 2009 01:26:33 -0800 (PST) From: "Yony Yossef" To: "'Julian Elischer'" , "Yony Yossef" References: <20def4870901140009y1f007108y92797d5f79ffac08@mail.gmail.com> <496E11B7.3010608@sepehrs.com> <000b01c9768e$745aa160$220f000a@mtl.com> <496EF30E.4010304@sepehrs.com> <000c01c976ec$87e040b0$220f000a@mtl.com> <496EF849.7040909@elischer.org> Date: Thu, 15 Jan 2009 11:26:34 +0200 Message-ID: <001501c976f3$5d7a81d0$220f000a@mtl.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acl27gFhXI+l5Z9aQiKGrodDmmFA4AABHJ6w X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 In-Reply-To: <496EF849.7040909@elischer.org> X-Mailman-Approved-At: Thu, 15 Jan 2009 12:21:43 +0000 Cc: Liran Liss , freebsd-net@freebsd.org, Oleg Kats , "'H.fazaeli'" , Eitan Shefi , freebsd-questions@freebsd.org Subject: RE: howto determine network device unit number? device.hints? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jan 2009 09:26:38 -0000 > Yony Yossef wrote: > > Thanks for the explanation. > > > > So there's no way to determine this in advance.. > > I must build a script that contains my own mapping between MAC > > addresses and the wanted interface names and run it after > each driver > > load, rename the interfaces if necessary. > > you must agree it's flexible. > > > It seems quite wrong, don't you agree? > > > > And how come the unit number is given an arbitrary value? > Is there a > > good reason for that? > > device discovery depends on what slot you put the card into. > so if you move it, it's number may change. > > also, how do you identify the particular card you want to > have a particular unit number? considering it may move (and > for example USB network interfaces WILL move if you add a > keyboard or any other device.. > > also to do as you want would take 2 passes. > first one to find the numbers needed and another to do what's left. > Julian, I'm not talking about the case where I'm physically switching card locations on the PCI bus. All I'm doing is unloading and reloading the driver. Unit numbers change and it makes my automatic subnet configuration (/etc/rc.conf) assign bad IPs. I still don't get the reason for this arbitrarily assigned unit numbers and what is the common solution for it. Except post load rename of the interfaces. Yony > > > > > Yony > > > > > > > > _____ > > > > From: H.fazaeli [mailto:fazaeli@sepehrs.com] > > Sent: Thursday, January 15, 2009 10:26 AM > > To: Yony Yossef > > Cc: freebsd-net@freebsd.org; freebsd-questions@freebsd.org > > Subject: Re: howto determine network device unit number? > device.hints? > > > > > > > > for example, say you have 2 interface em0 and em1 which you like to > > swap their minor numbers: > > > > ifconfig em0 name tmp > > ifconfig em1 name em0 > > ifconfig em0 name em1 > > > > or to assign cisco-like names to you interfaces: > > > > ifconfig xl0 name fastEthernet0 > > ifconfig em0 name gigaEthernet0 > > ifconfig fastEthernet0 192.168.1.0/24 > > > > > > Yony Yossef wrote: > > > > > > > > > > > > > > > > -----Original Message----- > > > > From: H.fazaeli [mailto:fazaeli@sepehrs.com] > > > > Sent: Wednesday, January 14, 2009 6:24 PM > > > > To: Yony Yossef > > > > Cc: freebsd-net@freebsd.org; freebsd-questions@freebsd.org; > > > > Eitan Shefi; Oleg Kats; Liran Liss > > > > Subject: Re: howto determine network device unit number? > device.hints? > > > > > > > > > > > > you may not change unit numbers as they are strictly > > > > controlled by kernel. > > > > However, on freebsd 5.3+, you may use 'ifconfig name > ' > > > > to achieve the same affect > > > > > > > > > > > > > > > > Sorry, I don't understand the usage of ifconfig you > suggested and the > > effect > > > > it will cause. > > > > Can you please explain it? > > > > Yony > > > > > > > > > > > > Yony Yossef wrote: > > > > > > > > Hi, > > > > > > > > I would like to determine the unit number of my network cards, e.g. > > > > make the device on pci0:16 be assigned every time with unit > > > > > > > > number 0 > > > > > > > > and pci0:19 with unit number 1. > > > > > > > > Is it done by /boot/device.hints? > > > > if so, how? > > > > > > > > My cards are: > > > > > > > > mtnic0@pci0:19:0:0: class=0x020000 card=0x001715b3 > > > > > > > > chip=0x636815b3 > > > > > > > > rev=0xa0 hdr=0x00 > > > > mtnic1@pci0:16:0:0: class=0x020000 card=0x001715b3 > > > > > > > > chip=0x636815b3 > > > > > > > > rev=0xa0 hdr=0x00 > > > > > > > > So I've tried: > > > > > > > > hint.mtnic.0.at="pci0:16" > > > > hint.mtnic.1.at="pci0:19" > > > > > > > > but it doesn't work. They keep switching arbitrarily. > > > > I'm using FreeBSD 7.0. > > > > > > > > Thanks > > > > Yony > > > > _______________________________________________ > > > > freebsd-questions@freebsd.org mailing list > > > > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > > > > To unsubscribe, send any mail to > > > > > > > > "freebsd-questions-unsubscribe@freebsd.org" > > > > > > > > > > > > > > > > > >