scrounge.org logo

Making Ethernet Adapters Work with Linux

I'm pointedly not covering networking in general here. I'm just going to talk about getting your Ethernet interface card (nic) working. Here is some more general information on setting up networking. In particular, check out the Linux Ethernet-Howto.

The general idea is to first configure the nic, if needed, and then use linuxconf to set the appropriate parameters. Even though you might be planning on using DHCP to connect to the Internet (say, through a cable modem), you will do yourself a big favor if you first configure the nic with a fixed address. Otherwise, you will be doing a lot of chasing your tail around if you try to simultaneously diagnose DHCP problems and "nic not recognized" problems.

First get the nic working by itself

Disconnect the nic from the rest of the network! Wait until you are sure that the nic is recognized by Linux before you connect it to the network.

If the nic is ISA and is "jumperless" then it probably defaults to Plug-and-Play mode (PNP) which often doesn't work well in Linux. I've had the best luck with jumperless ISA nics by first booting into DOS, running the setup/configuration program that comes with the nic and disabling PNP mode. Then check to see that the IRQ and ioports are non-conflicting and write them down. Then re-boot back into Linux.

Then start linuxconf. Go to Config/Networking/Client tasks/Basic host information.

linuxconf screen shot

Note that you should set Config Mode to Manual, and also enter a fixed IP address and subnet mask. Do not choose DHCP at this time. Check to see that the kernel module field is correct for your nic. (Check your distribution's documentation for this. Red Hat 5.x users can check the Network Module Listing page to find their list of supported nics.)

If the nic is an ISA one, then you should enter the I/O port and interrupt that you configured it with. (Notice that you have to preface the I/O port with "0x". 0x320 for address 320 hexadecimal, for example.) If it is PCI, then leave these fields blank.

After you set your parameters in linuxconf, then type ifconfig at the command prompt. You should see something like this:

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Bcast:127.255.255.255  Mask:255.0.0.0
          UP BROADCAST LOOPBACK RUNNING  MTU:3584  Metric:1
          RX packets:21 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0

eth0      Link encap:Ethernet  HWaddr 00:00:E8:DD:BB:83
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:87 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0
          Interrupt:11 Base address:0x320

lo is your "loopback" device and you will usually see that. It is a logical connection so that you can communicate with other network programs on the same machine, typically by using 127.0.0.1 as the IP address.

eth0 is the real ethernet card. If Linux recognizes it then you should see something similar to the above listing. If etho isn't listed, then Linux isn't happpy and you have to try changing something. Also note that the IP address is the same as what you set in Linuxconf.

You can also see how Linux recognizes it by listing various proc directories:

cat /proc/pci

PCI devices found:
  Bus  0, device   8, function  0:
    IDE interface: UMC UM8673F (rev 0).
      Medium devsel.
  Bus  0, device   5, function  0:
    Ethernet controller: DEC DC21140 (rev 32).
      Medium devsel.  Fast back-to-back capable.  IRQ 11.  Master Capable.
      Latency=40.  Min Gnt=20.Max Lat=40.
      I/O at 0xfc80.
      Non-prefetchable 32 bit memory at 0xffbeff80.
  Bus  0, device   1, function  0:
    ISA bridge: Silicon Integrated Systems 85C503 (rev 0).
      Medium devsel.  Master Capable.  No bursts.
  Bus  0, device   0, function  0:
    Host bridge: Silicon Integrated Systems 85C501 (rev 0).
      Fast devsel.  Master Capable.  No bursts.

Note the Ethernet controller entry. This is how Linux recognizes this PCI nic. If you see something along the lines of unrecognized Ethernet device then Linux doesn't recognize your nic. Time to remove it and try a different kind of nic. (ISA cards won't show up in /proc/pci no matter what. This is only for PCI cards.)

Also check cat /proc/ioports and cat /proc/interrupts. If Linux recognizes your nic and you did the linuxconf configuration properly, then your nic should show up here.

cat /proc/interrupts

 0:   23565023   timer
 1:       2031   keyboard
 2:          0   cascade
 4:          9 + serial
 8:          2 + rtc
10:      20531   eepro
13:          0   math error
14:     197590 + ide0

Problems? If you are using an ISA nic that you have disabled PNP, you might have a problem if the BIOS doesn't "see" it and attempts to assign its IRQ and I/O Ports to a PCI PNP card. You might be able to deal with this by going into your BIOS settings and seeing if there is any settings that will pre-allocate these resources. Look for the term "legacy."

Configuring DHCP

Now that we know that the nic is recognized by Linux we can proceed to configure DHCP. Start linuxconf and go to Config/Networking/Client tasks/Basic host information again.

linuxconf screen shot

Now we want to enable DHCP (and disable Manual) and erase the IP address and subnet mask that you entered before. Accept and Quit Linux conf.

Now shut your computer down (shutdown -h now). Wait until you see System is halted and turn the power off. Connect your Ethernet cable to the network (or cable modem). Then turn the power on and re-boot back into Linux. Pay attention to any messages about initializing the Ethernet card and DHCP.

If your computer "hangs" for more than several minutes when trying to initialize eth0, then it is having serious problems with configuring your ethernet card. You can get back into Linux by resetting and then typing linux init 1 at the Lilo prompt. When it boots, go into Linuxconf and disable the nic. Or try some other configuration. If the nic is ISA, double check your I/O and interrupt settings.

After you have booted and logged in then type ifconfig and see if eth0 exists and has a reasonable IP address. If it does, then try pinging an existing web site. ping yahoo.com. (Ctrl-C to exit out of ping.)

Nics we have known

NicDescriptionOur Comments
Intel Ether Express Pro 10 ISA 10 eepro kernel module. Doesn't work in PNP mode. Boot in DOS and run SOFTSET2.EXE from the driver disk to change parameters.
D-Link DE-220PCT ISA 10 ne kernel module. Doesn't work in PNP mode. Boot in DOS and run INSTALL.EXE on the driver diskette to install the configuration program to disable PNP.
Accton EN166x ISA 10 ne kernel module. Doesn't work in PNP mode. Boot in DOS and run 1STEP.EXE on the driver diskette to configure and disable PNP.
Osicom OS-PCI100 10/100 PCI tulip kernel driver. Will autosense and work at 10 or 100 speed, whichever is the fastest on the other end. Didn't work under RH 6.0.
Accton EN1208 10/100 PCI ne2k-pci kernel driver. Will not autosense and work at 10 or 100 speed. It only seems to work at 10 speed under Linux.
D-Link DFE-530TX 10/100 PCI Does not work under Red Hat 5.2 Linux. Was not recognized.

Does work in Red Hat 6.0, using the via-rhine module.

D-Link DFE-530TX+ 10/100 PCI Uses a completly different chipset than the DFE-530TX. It uses the RealTek 8139 chipset and the rtl8139 kernel module. Some users of RD and Mdk 7.x distros are reporting that it works better with the 8139too kernel module.
Accton Cheetah PCI Adapter 10/100 PCI Does not currently work under Red Hat 5.2 Linux. Was not recognized. However, the Accton web site now has a Linux driver for this card. I haven't tried it. It works in RH and Mdk 7.x for me with the rtl8139 kernel module.

If you have an ISA device and don't know what kernel module to try, try the ne one. For a PCI nic, try tulip. These are the most common. Here is the Red Hat Hardware Compatiblity List And don't forget the Linux Ethernet-Howto.

Don't have the drivers disk? Then try to find the manufacturer's web site and see if the drivers are downloadable. For Linux you don't need any of the drivers, but you might need the DOS configuration program that is usually somewhere on the drivers disk. And you will (probably) need the drivers disk if you also want to use the nic with Windows.

Still doesn't work? Big surprise. Check the Linux documentation page and look through the HOW-TOs and mini-HOW-TOs. And maybe check the Red Hat manual or any other manual that came with your distribution.

Also see Using Linux with a Cable Modem and Use IPWatch to monitor your network connection.


Back to the scrounge.org home page.