From owner-freebsd-questions@FreeBSD.ORG Thu Jan 15 09:38:55 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 EC2BA1065680; Thu, 15 Jan 2009 09:38:55 +0000 (UTC) (envelope-from fazaeli@sepehrs.com) Received: from sepehrs.com (www.sepehrs.com [213.217.59.98]) by mx1.freebsd.org (Postfix) with ESMTP id B6B1E8FC1D; Thu, 15 Jan 2009 09:38:54 +0000 (UTC) (envelope-from fazaeli@sepehrs.com) Received: from [192.168.1.180] ([192.168.1.180]) by sepehrs.com (8.13.6/8.13.6) with ESMTP id n0F9gQtB057075; Thu, 15 Jan 2009 13:12:26 +0330 (IRST) (envelope-from fazaeli@sepehrs.com) Message-ID: <496F012A.2040807@sepehrs.com> Date: Thu, 15 Jan 2009 12:56:02 +0330 From: "H.fazaeli" User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: 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> In-Reply-To: <000c01c976ec$87e040b0$220f000a@mtl.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Sepehr-MailScanner-Information: Please contact the ISP for more information X-Sepehr-MailScanner: Found to be clean X-Sepehr-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.399, required 5, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60) X-MailScanner-From: fazaeli@sepehrs.com X-Spam-Status: No Cc: freebsd-net@freebsd.org, freebsd-questions@freebsd.org, Yony Yossef 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:38:56 -0000 Yony Yossef wrote: > Thanks for the explanation. > > So there's no way to determine this in advance.. > What do you mean by 'in advance'? Assuming a fixed hardware configuration, when the kernel is loaded, you know all the interface names and can rename them, i.e., in rc.local. > 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. > I do not quite understand your requirement. Can you please explain? Do you need a script that works on multiple machines with different hardwares? > 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? > > 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" > > > > > > > > > -- Best regards. Hooman Fazaeli Sepehr S. T. Co. Ltd. Web: http://www.sepehrs.com Tel: (9821)88975701-2 Fax: (9821)88983352