From owner-freebsd-questions Tue Feb 18 12:23:17 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A03937B401 for <questions@freebsd.org>; Tue, 18 Feb 2003 12:23:14 -0800 (PST) Received: from mail.flugsvamp.com (ts46-01-qdr3643.mdfrd.or.charter.com [68.118.36.71]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8608B43F3F for <questions@freebsd.org>; Tue, 18 Feb 2003 12:23:13 -0800 (PST) (envelope-from jlemon@flugsvamp.com) Received: (from jlemon@localhost) by mail.flugsvamp.com (8.12.6/8.12.6) id h1IKMnsK070446; Tue, 18 Feb 2003 14:22:49 -0600 (CST) (envelope-from jlemon) Date: Tue, 18 Feb 2003 14:22:49 -0600 (CST) From: Jonathan Lemon <jlemon@flugsvamp.com> Message-Id: <200302182022.h1IKMnsK070446@mail.flugsvamp.com> To: tlt@badger.tltodd.com, questions@freebsd.org Subject: Re: NIC numbering X-Newsgroups: local.mail.freebsd-questions In-Reply-To: <local.mail.freebsd-questions/20030218134447.A50161@badger.tltodd.com> References: <local.mail.freebsd-questions/20030215082835.A34779@badger.tltodd.com> <local.mail.freebsd-questions/20030217123009.GA8983@postecom.it> <local.mail.freebsd-questions/20030217130819.GA1275@raggedclown.net> <local.mail.freebsd-questions/20030218110230.A42817@badger.tltodd.com> <local.mail.freebsd-questions/20030218173548.GB20940@happy-idiot-talk.infracaninophi> <local.mail.freebsd-questions/200302181752.h1IHqMGt067351@mail.flugsvamp.com> Organization: Cc: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: <freebsd-questions.FreeBSD.ORG> List-Archive: <http://docs.freebsd.org/mail/> (Web Archive) List-Help: <mailto:majordomo@FreeBSD.ORG?subject=help> (List Instructions) List-Subscribe: <mailto:majordomo@FreeBSD.ORG?subject=subscribe%20freebsd-questions> List-Unsubscribe: <mailto:majordomo@FreeBSD.ORG?subject=unsubscribe%20freebsd-questions> X-Loop: FreeBSD.ORG In article <local.mail.freebsd-questions/20030218134447.A50161@badger.tltodd.com> you write: >On Tue, Feb 18, 2003 at 11:52:22AM -0600, Jonathan Lemon wrote: >> In article ><local.mail.freebsd-questions/20030218173548.GB20940@happy-idiot-talk.infracaninophi> you write: >> >On Tue, Feb 18, 2003 at 11:02:30AM -0600, Terry Todd wrote: >> >> On Mon, Feb 17, 2003 at 02:08:19PM +0100, Cliff Sarginson wrote: >> >> > On Mon, Feb 17, 2003 at 01:30:09PM +0100, Andrea Franceschini wrote: >> >> > > On Sat, Feb 15, 2003 at 08:28:35AM -0600, Terry Todd wrote: >> >> > > > When you have more than one of the same type of NIC card in one >> >> > > > machine is there a way to insure that the NIC numbering remains >> >> > > > attached to the same card / MAC address if more cards are added or >> >> > > > they are moved around? >> >> > > > >> >> >> >> Here's an example. >> >> >> >> The original setup: >> >> >> >> $ ifconfig -a >> >> rl0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 >> >> ether 00:e0:29:85:49:b6 >> >> media: Ethernet autoselect (10baseT/UTP) >> >> status: no carrier >> >> rl1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 >> >> ether 00:e0:29:85:49:d0 >> >> media: Ethernet autoselect (10baseT/UTP) >> >> status: no carrier >> >> >> >> After the cards are switched around in the PCI slots: >> >> >> >> $ ifconfig -a >> >> rl0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 >> >> ether 00:e0:29:85:49:d0 >> >> media: Ethernet autoselect (10baseT/UTP) >> >> status: no carrier >> >> rl1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 >> >> ether 00:e0:29:85:49:b6 >> >> media: Ethernet autoselect (10baseT/UTP) >> >> status: no carrier >> >> >> >> How can I keep rl0 associated with MAC 00:e0:29:85:49:b6 >> >> and rl1 associated with MAC 00:e0:29:85:49:d0 and still >> >> be able to add cards or move them around? >> > >> >About the best you can do is use ifconfig(8) to set the MAC address at >> >the same time as you configure the interface: >> > >> > ifconfig rl0 ether 00:e0:29:85:49:b6 >> > ifconfig rl1 ether 00:e0:29:85:49:d0 >> > >> >which will cause the MAC address to stick with the interface number, >> >rather than the actual card. That will work if you just keep the two >> >cards as you've shown here, but if you add a new card that happens to >> >end up as rl0 then you'll probably end up with a mess. >> > >> >As far as I know, there's no way of wiring down interface numbers to >> >PCI bus slots, analogously to the way you can wire down SCSI devices >> >by bus, target and LUN --- see the section on 'SCSI DEVICE >> >CONFIGURATION' in LINT. You'ld probably have to go a bit linux-ish >> >and have, say, eth0 as the generic name for an ethernet interface >> >independant of the actual chipset on the NIC in order to make the most >> >sense of that sort of wiring-down idea. >> >> Actually, this capability has been in 5.0 for a long time, but I don't >> think that it was ever MFC'd to 4.x. There are network aliases for the >> actual physical devices, which appear as /dev/netN, where N is the >> index number used. These can be wired either by name or ether number >> at boot time: >> >> Allow wiring of net aliases in /boot/device.hints of the form: >> hint.net.1.dev="lo0" >> or >> hint.net.12.ether="00:a0:c9:c9:9d:63" >> >> >> So for the original poster, you could do (in 5.0): >> >> hint.net.1.ether="00:e0:29:85:49:b6" >> hint.net.2.ether="00:e0:29:85:49:d0" >> >> > ifconfig net1 >> rl1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 >> ether 00:e0:29:85:49:b6 >> media: Ethernet autoselect (10baseT/UTP) >> status: no carrier >> >> > ifconfig net2 >> rl0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500 >> ether 00:e0:29:85:49:d0 >> media: Ethernet autoselect (10baseT/UTP) >> status: no carrier >> >> And the 'net1','net2' aliases will remain bound to whichever driver has >> those actual ethernet addresses, regardless of PCI ordering. >> -- >> Jonathan >> > >Thanks. > >That works for after the system is booted up and running. > >I tried adding ifconfig_net1/2 lines to rc.conf and it didn't work. > >ifconfig_net1="inet 10.0.0.3 netmask 255.0.0.0" You'll need to manually specify the interface list, the default is to configure only the physical interfaces, not any aliases: network_interfaces="lo0 net1 net2" -- Jonathan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message