[Techtalk] detecting what ethernet device kernel supports

Maria Blackmore mariab at cats.meow.at
Sun Oct 20 04:49:31 EST 2002


On Sat, 19 Oct 2002, Kathryn Hargreaves wrote:

> How do I detect what ethernet card(s) my kernel supports?
> It doesn't seem to be detecting the right one.

In order for a kernel to support an ethernet card, it must either have the
device driver for that card either compiled into it or loaded as a module.

In general, you should be able to select the network card you have when
you are compiling your kernel.  If you aren't using a kernel that you
compiled yourself, then your distribution should have supplied a variety
of modules, and you need to pick the right one and tell it to use it.

If you know what kind of ethernet card you have, then you can look for the
right module, and try it out by `modprobe modulename`.  I have an Intel
Ethernet Pro 100, so I would `modprobe eepro100`.  If you're not sure what
ethernet card you have, then you should find something useful from `lspci
| grep -i eth`, or just looking through the output from lspci for your
card.

Once you have found the right card you can either compile it into your own
kernel, or leave things the way they are and edit /etc/modules.conf to
contain a line that says "alias eth0 ethernetmodulename", of course
replacing "ethernetmodulename" as appropriate.  In my case it has "alias
eth0 eepro100"  (this is technically a lie, since I have it compiled
straight into the kernel, and thus this isn't needed :)

You can usually find out what ethernet drivers have been tried by the
kernel already by looking at the output from `dmesg` a short time after
boot, or by looking through /var/log/boot.msg or /var/log/dmesg (or
whatever the equivalent is for your distribution that lists the messages
that were output by the kernel during boot).  In my case I have this:

eepro100.c:v1.09j-t 9/29/99 Donald Becker http://www.scyld.com/network/eepro100.html
eepro100.c: $Revision: 1.36 $ 2000/11/17 Modified by Andrey V. Savochkin <saw at saw.sw.com.sg> and others
eth0: OEM i82557/i82558 10/100 Ethernet, 00:08:C7:9A:C4:74, IRQ 12.
  Receiver lock-up bug exists -- enabling work-around.
  Board assembly 702536-006, Physical connectors present: RJ45
  Primary interface chip i82555 PHY #1.
  General self-test: passed.
  Serial sub-system self-test: passed.
  Internal registers self-test: passed.
  ROM checksum self-test: passed (0x24c9f043).
  Receiver lock-up workaround activated.

In general, each device driver in the kernel will output a little info
about itself and what it has found as it initialises.  When loading your
own kernel modules, you'll be able to see this at the end of the output
from `dmesg`.

You will be able to see what modules (if any) you have loaded using
`lsmod`, modules may be loaded with `modprobe` and removed if unwanted
with `rmmod`.  All these must be run as root.

> For that matter, how do I tell which version kernel I have?

`uname -a` should produce helpful output here.


I hope you find this useful, and good luck :)

Maria




More information about the Techtalk mailing list