Created: 9/05/02 Revised: 4/6/04 Basic PCI Network Interface Card (NIC) Configuration and Troubleshooting: As different distros use different GUI (graphical) network configuration programs, the following instructions are command-line based, and as such should work for most distros. If you boot directly into the GUI (KDE, Gnome, etc.) as opposed to booting into a non-graphical runlevel, open a terminal window and type the given commands from there. Much of the following can only be done as root, so either log in as root, or "su" to root if logged in as a non-root user. *Note: some commands can only be run from root's login shell. When the su command is used by itself, it allows a non-root user to become root, but only from within the user's own login shell. To gain a full root login shell without having to log out and log back in as root, use the "-" option when issuing the su command: su - . If you have only 1 NIC installed, it will be designated "eth0"; additional NICs will be designated eth1, eth2, etc. Before doing any of the following, *please* check the Hardware Compatibility List at your distro's support site. If your particular make/model of NIC is not listed as being compatible with your distro, there is good chance that it may not work at all, or that you may have to take extra steps (such as downloading a special driver/module) in order to get it working. Considering the fact that NICs are fairly inexpensive, it is often just not worth spending time and energy trying to "force" an unsupported card to work. ------------------------------------------------------------------------------------------------------------------------------ 1. If, on bootup, you see a message similar to "Bringing up interface eth0: FAILED", it is very possible that you have a resource (IRQ or I/O address) conflict. Turn off Plug-N-Play support in your BIOS before proceeding further; BIOS PNP can often cause problems with PCI devices under a non-Windows OS. If you dual-boot Windows and Linux, don't worry- your PCI devices should still work in Windows with BIOS PNP disabled, as the PNP functionality of the Windows OS itself will perform the necessary resource allocation. *Note: If you are connecting to a network or ISP via DHCP, and you see a message on bootup similar to "Determining IP information for device eth0: FAILED", that can indicate a problem with your DHCP configuration (or the DHCP server) This article doesn't deal with DHCP issues, but I hope to be able to post one that does in the future. 2. Use one of the following commands to verify that your card is at least basically identifying itself to the system: lspci -vv |less less /proc/pci cat /proc/pci In the resulting output, look for the "Ethernet Controller" entry. It should contain information about your model of card and/or its chipset, as well as IRQ, I/O port, and memory address values. 3. Run the ifconfig command; information concerning your NIC should appear in the resulting output. You should also see stats for the loopback (lo) device 127.0.0.1. If you've already tried to enter your IP info (inet addr, Bcast, Mask) through a GUI network configuration utility, verify that those values are correctly reflected in ifconfig's output. Also check for RX/TX errors and collisions. If eth0 is not listed when you run ifconfig, try "ifconfig -a"; the "-a" option forces ifconfig to report all network interfaces, active or not. If eth0 appears only when you run ifconfig with the -a option, it is definitely not correctly configured. 4. Verify that the correct module is being loaded for your ethernet card by issuing the "lsmod" command; you should see the module name in the resulting list of loaded modules. If not, issue the following two commands and try again: depmod -ae modprobe *Note- documentation concerning module loading will often refer to the "insmod" command, but use modprobe instead if it's available. Basically, insmod is not as "intelligent" as modprobe in the fact that it doesn't try to resolve module dependencies (where the successful loading of a given module "depends" on another module being loaded first). If the module appears as loaded after that, check your /etc/modules.conf (/etc/conf.modules in some distros)file to make sure that it has an entry for the module; this will load the module automagically each time you boot. The line will look like this: alias eth0 If the line doesn't exist, add it by editing the file with your favorite text editor. 5. Run the following two commands: less /proc/interrupts less /proc/ioports For the first command, note the IRQ assigned to eth0; verify that it matches the Interrupt value listed when you ran the ifconfig command, and note if the assigned interrupt is being shared with another device. If so, this doesn't necessarily indicate a problem, but it can. For the second command, make sure that the address range of your Ethernet controller doesn't conflict with/overlap that of another device. Also make sure that the start of the address range corresponds to the Base address value shown for eth0 when you ran ifconfig. 6. If any of the above steps yield errors or indicate conflicts even after you've turned off PNP support in the BIOS, try physically rearranging the slot order of your PCI cards; doing so can force a reallocation of resources to devices on the PCI bus. 7. Once you're sure that the NIC is correctly configured and the module is properly loaded, you can try to bring the card up with the following command: ifconfig eth0 netmask up If you get no errors, you should at least then be able to ping the IP address of the NIC. -------------------------------------------------------------------------------------------------------------------------------- Distro-specific configuration files: ------------------------------------ Redhat, Mandrake, and a few other distros use the following two basic network interface configuration files: /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth0 The format of the files may vary slightly across distros/versions, but the the pertinent contents of the files should be very similar to: /etc/sysconfig/network: NETWORKING=yes FORWARD_IPV4="no" HOSTNAME="your_machine's_hostname" DOMAINNAME="your_domain_name" ("localhost" is valid here) GATEWAY="IP_address_of_your_gateway_machine/device" (if applicable) GATEWAYDEV="eth0" /etc/sysconfig/network-scripts/ifcfg-eth0: DEVICE='eth0' BOOTPROTO='none' BROADCAST='broadcast_address_of_your_IP_address_range' NETWORK='network_address_of_your_IP_range' ONBOOT='yes' TYPE='Ethernet' USERCTL='no' IPADDR='your_machine's_IP_address' GATEWAY='IP_address_of_your_gateway_machine/device' NETMASK='netmask_of_your_IP_range' -------------------------------------------------------------------------------------------------------------------------------- An explanation of IP addressing as a whole (including terms such as "netmask", "network address", "broadcast address",etc.) is well beyond the scope of this Help File. However, the following sites provide some good background information: http://www.cisco.com/warp/public/701/3.html http://www.ipprimer.com/section.cfm http://www.oreilly.com/catalog/coreprot/chapter/appb.html http://linux-ip.net/html/index.html -------------------------------------------------------------------------------------------------------------------------------- - Further resources, including NIC driver source code and diagnostic utilities can be found at http://www.scyld.com/network. * Note that as of 3/04 the Scyld site appears to have undergone changes; some links on the above page are broken. -------------------------------------------------------------------------------------------------------------------------------- #include This is, as a whole, a work in progress. It might (and probably does) contain omissions and/or slight inaccuracies. However, none of the suggestions given here will do any harm to your system if performed correctly. Being a work in progress, any suggestions/corrections/critcisms are more than welcome. If you've noticed any errors in the above, or just have something constructive to suggest, feel free to email me: david@dmrca.com