2 Questions (1 off topic)

Derrik Pates dpates@dsdk12.net
Wed, 15 Aug 2001 21:48:33 -0600 (MDT)


On Fri, 10 Aug 2001, Matt Prigge wrote:

> > 2) This is the off topic one.  I changed one of the ethernet cards in
> Linux
> > box, and when I rebooted I found that my one I hadn't changed (which was
> > eth1) was now eth0 and the new one became eth1   - no biggie as I just
> > swapped the ethernet cables arround - but it made me think. How does Linux
> > know which card is which? Every time I boot it picks the same card as eth0
> > and eth1 - unless I change one.  There must be a config file which says
> this
> > somewhere.  I have to admit I haven't done due dilligence and looked for
> an
> > answer on the web - but if someone else knows....

Depends on when the driver's loaded. If it's built into the kernel, the
system initializes the built-in drivers in a certain order, andd they each
probe for cards in their own way. So, if you have two cards of different
models, whichever driver is first in the init list will be eth0. If
they are supported by the same driver, thee order of detection can be
influenced by bus order (PCI) or port address (ISA) (this isn't
necessarily sequential either, depends on the driver's IO port probe order
list).

Of course, if your NIC drivers are built out as modules, then whichever
driver you load first gets the first name (but if you have more than one
card supported by the one driver, the bus order or port address order will
affect the naming).

Derrik Pates      |   Sysadmin, Douglas School   |    #linuxOS on EFnet
dpates@dsdk12.net |     District (dsdk12.net)    |    #linuxOS on OPN