529 lines
12 KiB
HTML
529 lines
12 KiB
HTML
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Ethernet Installation</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
|
|
REL="HOME"
|
|
TITLE="Linux Network Administrators Guide"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="Configuringthe NetworkingHardware"
|
|
HREF="x-087-2-hardware.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="A Tour of Linux Network Devices"
|
|
HREF="x-087-2-hwconfig.tour.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="The PLIP Driver"
|
|
HREF="x-087-2-hardware.drivers.plip.html"></HEAD
|
|
><BODY
|
|
CLASS="SECT1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>Linux Network Administrators Guide</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x-087-2-hwconfig.tour.html"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 3. Configuringthe NetworkingHardware</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x-087-2-hardware.drivers.plip.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECT1"
|
|
><H1
|
|
CLASS="SECT1"
|
|
><A
|
|
NAME="X-087-2-HARDWARE.DRIVERS.ETHERNET"
|
|
>3.3. Ethernet Installation</A
|
|
></H1
|
|
><P
|
|
>The current Linux network code supports a large variety of Ethernet
|
|
cards. Most drivers were written by Donald Becker, who authored a
|
|
family of drivers for cards based on the National Semiconductor 8390
|
|
chip; these have become known as the Becker Series Drivers. Many other
|
|
developers have contributed drivers, and today there are few common
|
|
Ethernet cards that aren't supported by Linux. The list of supported
|
|
Ethernet cards is growing all the time, so if your card isn't
|
|
supported yet, chances are it will be soon.</P
|
|
><P
|
|
>Sometime earlier in Linux's history we would have attempted to list
|
|
all supported Ethernet cards, but that would now take too much time
|
|
and space. Fortunately, Paul Gortmaker maintains the Ethernet HOWTO,
|
|
which lists each of the supported cards and provides useful
|
|
information about getting each of them running under Linux.<A
|
|
NAME="X-087-2-FNHW04"
|
|
HREF="#FTN.X-087-2-FNHW04"
|
|
>[1]</A
|
|
> It is posted monthly to the <SPAN
|
|
CLASS="SYSTEMITEM"
|
|
>comp.os.linux.answers</SPAN
|
|
> newsgroup, and is
|
|
also available on any of the Linux Documentation Project mirror sites. </P
|
|
><P
|
|
>Even if you are confident you know how to install a particular type of
|
|
Ethernet card in your machine, it is often worthwhile taking a look at
|
|
what the Ethernet HOWTO has to say about it. You will find information
|
|
that extends beyond simple configuration issues. For example, it could
|
|
save you a lot of headaches to know the
|
|
behavior of some DMA-based Ethernet cards that use the same DMA
|
|
channel as the Adaptec 1542 SCSI controller by default. Unless you move
|
|
one of them to a different DMA channel, you will wind up with the
|
|
Ethernet card writing packet data to arbitrary locations on your hard
|
|
disk.</P
|
|
><P
|
|
>To use any of the supported Ethernet cards with Linux, you may use a
|
|
precompiled kernel from one of the major Linux distributions. These generally
|
|
have modules available for all of the supported drivers, and the installation
|
|
process usually allows you to select which drivers you want loaded. In the
|
|
long term, however, it's better to build your own kernel and compile only
|
|
those drivers you actually need; this saves disk space and memory.</P
|
|
><DIV
|
|
CLASS="SECT2"
|
|
><H2
|
|
CLASS="SECT2"
|
|
><A
|
|
NAME="AEN2510"
|
|
>3.3.1. Ethernet Autoprobing</A
|
|
></H2
|
|
><P
|
|
>Many of the Linux Ethernet drivers are smart enough to know how to
|
|
search for the location of your Ethernet card. This saves you having
|
|
to tell the kernel where it is manually. The Ethernet HOWTO lists
|
|
whether a particular driver uses autoprobing and in which order it
|
|
searches the I/O address for the card.</P
|
|
><P
|
|
>There are three limitations to the autoprobing code. First, it may not
|
|
recognize all cards properly. This is especially true for some of the cheaper
|
|
clones of common cards. Second, the kernel won't
|
|
autoprobe for more than one card unless specifically instructed. This was
|
|
a conscious design decision, as it is assumed you will want to have control
|
|
over which card is assigned to which interface. The best way to do this
|
|
reliably is to manually configure the Ethernet cards in your machine. Third,
|
|
the driver may not probe at the address that your card is configured for.
|
|
Generally speaking, the drivers will autoprobe at the addresses that the
|
|
particular device is capable of being configured for, but sometimes certain
|
|
addresses are ignored to avoid hardware conflicts with other types of cards
|
|
that commonly use that same address.</P
|
|
><P
|
|
>PCI network cards should be reliably detected. But if you are using more
|
|
than one card, or if the autoprobe should fail to detect your card, you
|
|
have a way to explicitly tell the kernel about the card's base address and
|
|
name.</P
|
|
><P
|
|
>
|
|
|
|
|
|
At boot time you can supply arguments and information to the kernel that any
|
|
of the kernel components may read. This mechanism allows you
|
|
to pass information to the kernel that Ethernet drivers can use to locate your
|
|
Ethernet hardware without making the driver probe.</P
|
|
><P
|
|
>If you use lilo to boot your system, you can pass parameters
|
|
to the kernel by specifying them through the
|
|
<SPAN
|
|
CLASS="SYSTEMITEM"
|
|
>append</SPAN
|
|
> option in the
|
|
<TT
|
|
CLASS="FILENAME"
|
|
>lilo.conf</TT
|
|
> file. To inform the kernel about an
|
|
Ethernet device, you can pass the following parameters:</P
|
|
><P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="SCREEN"
|
|
>ether=<TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>irq</I
|
|
></TT
|
|
>,<TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>base_addr</I
|
|
></TT
|
|
>,[<TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>param1</I
|
|
></TT
|
|
>,][<TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>param2</I
|
|
></TT
|
|
>,]<TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>name</I
|
|
></TT
|
|
></PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></P
|
|
><P
|
|
>The first four parameters are numeric, while the last is the device
|
|
name. The <TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>irq</I
|
|
></TT
|
|
>,
|
|
<TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>base_addr</I
|
|
></TT
|
|
>, and
|
|
<TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>name</I
|
|
></TT
|
|
> parameters are required, but the two
|
|
<TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>param</I
|
|
></TT
|
|
> parameters are optional. Any of the
|
|
numeric values may be set to zero, which causes the kernel to
|
|
determine the value by probing.</P
|
|
><P
|
|
>
|
|
The first parameter sets the IRQ assigned to the device. By default, the
|
|
kernel will try to autodetect the device's IRQ channel. The 3c503 driver,
|
|
for example, has a special feature that selects a free IRQ from the list
|
|
5, 9, 3, 4 and configures the card to use this line.
|
|
The <TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>base_addr</I
|
|
></TT
|
|
> parameter gives the I/O base address
|
|
of the card; a value of zero tells the kernel to probe the addresses listed
|
|
above.</P
|
|
><P
|
|
>Different drivers use the next two parameters differently. For shared-memory cards, such as the WD80x3, they specify starting and ending
|
|
addresses of the shared memory area. Other cards commonly use
|
|
<TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>param1</I
|
|
></TT
|
|
> to set the level at which debugging
|
|
information is displayed. Values of 1 through 7 denote increasing levels of
|
|
verbosity, while 8 turns them off altogether; 0 denotes the default.
|
|
The 3c503 driver uses <TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>param2</I
|
|
></TT
|
|
> to choose between the
|
|
internal transceiver (default) or an external transceiver (a value of 1).
|
|
The former uses the card's BNC connector; the latter uses its AUI port.
|
|
The <TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>param</I
|
|
></TT
|
|
> arguments need not be included at all
|
|
if you don't have anything special to configure.</P
|
|
><P
|
|
>The first non-numeric argument is interpreted by the kernel as the
|
|
device name. You must specify a device name for each Ethernet card you
|
|
describe.</P
|
|
><P
|
|
>If you have two Ethernet cards, you can have Linux autodetect one card
|
|
and pass the second card's parameters with <B
|
|
CLASS="COMMAND"
|
|
>lilo</B
|
|
>,
|
|
but you'll probably want to manually configure both cards. If you
|
|
decide to have the kernel probe for one and manually configure the
|
|
second, you must make sure the kernel doesn't accidentally find the
|
|
second card first, or else the other one won't be registered at
|
|
all. You do this by passing <B
|
|
CLASS="COMMAND"
|
|
>lilo</B
|
|
> a <SPAN
|
|
CLASS="SYSTEMITEM"
|
|
>reserve</SPAN
|
|
> option, which explicitly tells the
|
|
kernel to avoid probing the I/O space taken up by the second card. For
|
|
instance, to make Linux install a second Ethernet card at
|
|
<TT
|
|
CLASS="LITERAL"
|
|
>0x300</TT
|
|
> as <TT
|
|
CLASS="FILENAME"
|
|
>eth1</TT
|
|
>, you would pass
|
|
the following parameters to the kernel:</P
|
|
><P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="SCREEN"
|
|
>reserve=0x300,32 ether=0,0x300,eth1</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></P
|
|
><P
|
|
>The <I
|
|
CLASS="EMPHASIS"
|
|
>reserve</I
|
|
> option makes sure no driver
|
|
accesses the second card's I/O space when probing for some device. You may
|
|
also use the kernel parameters to override autoprobing for
|
|
<TT
|
|
CLASS="FILENAME"
|
|
>eth0</TT
|
|
> :</P
|
|
><P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="SCREEN"
|
|
>reserve=0x340,32 ether=0,0x340,eth0</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></P
|
|
><P
|
|
>You can turn off autoprobing altogether. You might do this, for example, to
|
|
stop a kernel probing for an Ethernet card you might have temporarily removed.
|
|
Disabling autoprobing is as simple as specifying a
|
|
<TT
|
|
CLASS="REPLACEABLE"
|
|
><I
|
|
>base_addr</I
|
|
></TT
|
|
> argument of –1:</P
|
|
><P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="SCREEN"
|
|
>ether=0,-1,eth0</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></P
|
|
><P
|
|
>To supply these parameters to the kernel at boot time, you enter the
|
|
parameters at the lilo "boot:" prompt. To have <B
|
|
CLASS="COMMAND"
|
|
>lilo</B
|
|
>
|
|
give you the "<TT
|
|
CLASS="PROMPT"
|
|
>boot:</TT
|
|
>" at the prompt, you must press
|
|
any one of the Control, Alt or Shift keys while
|
|
<B
|
|
CLASS="COMMAND"
|
|
>lilo</B
|
|
> is booting. If you press the Tab key at the
|
|
prompt, you will be presented with a list of kernels that you may
|
|
boot. To boot a kernel with parameters supplied, enter the name of the
|
|
kernel you wish to boot, followed by a space, then followed by the
|
|
parameters you wish to supply. When you press the Enter key,
|
|
<B
|
|
CLASS="COMMAND"
|
|
>lilo</B
|
|
> will load that kernel and boot it with the
|
|
parameters you've supplied.</P
|
|
><P
|
|
>To make this change occur automatically on each reboot, enter the parameters
|
|
into the <TT
|
|
CLASS="FILENAME"
|
|
>/etc/lilo.conf</TT
|
|
> using the
|
|
<TT
|
|
CLASS="LITERAL"
|
|
>append=</TT
|
|
> keyword. An example might look like this:
|
|
|
|
<TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><PRE
|
|
CLASS="SCREEN"
|
|
>boot=/dev/hda
|
|
root=/dev/hda2
|
|
install=/boot/boot.b
|
|
map=/boot/map
|
|
vga=normal
|
|
delay=20
|
|
append="ether=10,300,eth0"
|
|
|
|
image=/boot/vmlinuz-2.2.14
|
|
label=2.2.14
|
|
read-only</PRE
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
></P
|
|
><P
|
|
>After you've edited <TT
|
|
CLASS="FILENAME"
|
|
>lilo.conf</TT
|
|
>, you must rerun
|
|
the <B
|
|
CLASS="COMMAND"
|
|
>lilo</B
|
|
> command to activate the change.</P
|
|
><P
|
|
>
|
|
</P
|
|
></DIV
|
|
></DIV
|
|
><H3
|
|
CLASS="FOOTNOTES"
|
|
>Notes</H3
|
|
><TABLE
|
|
BORDER="0"
|
|
CLASS="FOOTNOTES"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
WIDTH="5%"
|
|
><A
|
|
NAME="FTN.X-087-2-FNHW04"
|
|
HREF="x-087-2-hardware.drivers.ethernet.html#X-087-2-FNHW04"
|
|
>[1]</A
|
|
></TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
WIDTH="95%"
|
|
><P
|
|
> Paul can be reached at <SPAN
|
|
CLASS="SYSTEMITEM"
|
|
>gpg109@rsphy1.anu.edu.au</SPAN
|
|
>.</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x-087-2-hwconfig.tour.html"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x-087-2-hardware.drivers.plip.html"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>A Tour of Linux Network Devices</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x-087-2-hardware.html"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>The PLIP Driver</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |