old-www/LDP/LG/issue62/tag/1.html

217 lines
8.6 KiB
HTML

<!--startcut ======================================================= -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<META NAME="generator" CONTENT="lgazmail v1.3E.n">
<TITLE>The Answer Gang 62: Renaming Ethernet Devices</TITLE>
</HEAD><BODY BGCOLOR="#FFFFFF" TEXT="#000000"
LINK="#3366FF" VLINK="#A000A0">
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<P> <hr>
<CENTER>
<!-- *** BEGIN navbar *** -->
<!-- *** END navbar *** -->
</CENTER>
</p>
<P> <hr> <P>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<center>
<H1><A NAME="answer">
<img src="../../gx/dennis/qbubble.gif" alt="(?)"
border="0" align="middle">
<font color="#B03060">The Answer Gang</font>
<img src="../../gx/dennis/bbubble.gif" alt="(!)"
border="0" align="middle">
</A></H1>
<BR>
<H4>By Jim Dennis, Ben Okopnik, Dan Wilder, Breen Mullins, Mitchell Bruntell, the Editors of Linux Gazette...
and You!
<br>Send questions (or interesting answers) to
<a href="mailto:linux-questions-only@ssc.com">linux-questions-only@ssc.com</a>
</H4>
</center>
<p><hr><p>
<!-- endcut ======================================================= -->
<!-- begin 1 -->
<H3 align="left"><img src="../../gx/dennis/qbubble.gif"
height="50" width="60" alt="(?) " border="0"
>Renaming Ethernet Devices</H3>
<p><strong>From Matthew Keller
</strong></p>
<p align="right"><strong>Answered By Mike Orr, Heather Stern
<br></strong></p>
<!-- sig -->
<P><STRONG>
Ok, so this is probably a trivial problem, but it's one I've had for
years. If I have 3 Ethernet devices (eth0,eth1,eth2), I want to be able
to tell Linux WHICH one I want to be which. If they are of different
kinds (or at least have different drivers) I can fool Linux by
specifying them in <TT>/etc/conf.modules</TT> (or modules.conf for RH7 users) and
defining which card gets which name. How do I do that if they're all the
same kind?!
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Mike]
I've tried to do that before too, but I haven't found a way. It seems
like a glaring ommission. I just
use different brands of cards, and then I can decide which order to insmod
the modules. Obviously, each card is attached to a different network,
and it's important to know card X is eth0 so you can configure the right
card for the right network.
</BLOCKQUOTE>
<BLOCKQUOTE>
The worst part is, if the first card is removed or fizzles out, the second
card becomes eth0, and your startup script will initialize the wrong
card, and presto, no network.
</BLOCKQUOTE>
<BLOCKQUOTE>
You may find they get detected in order of hardware address. PCI slots
have fixed addresses, so you may be able to move the cards among
different slots and get the order you want.
</BLOCKQUOTE>
<BLOCKQUOTE>
(If they were ISA cards like the 3C509, you would the DOS program <TT>3C5X9.EXE</TT> to
set the hardware address on each card. Other ISA cards you would set jumpers
on, if you're lucky enough to find documentation about which setting is which!
Dunno about plug n play, but on the 3C509 you can turn off plug n play using
the same program. You could also use LILO's "ether=" parameter to specify
which order you want the hardware addresses probed.)
</BLOCKQUOTE>
<P><STRONG><IMG SRC="../../gx/dennis/qbub.gif" ALT="(?)"
HEIGHT="28" WIDTH="50" BORDER="0"
>
What brings this to mind now, is that I have a new server, fresh
install, one on-motherboard Intel NIC and 2 PCI NIC's. Linux picked the
first PCI NIC to be Eth0, the second to be Eth1 and the on-board to be
Eth2, and I'm just demented enough to argue with it.
<IMG SRC="../../gx/dennis/smily.gif" ALT=":)"
height="24" width="20" align="middle">
</STRONG></P>
<P><STRONG>
Matthew Keller
</STRONG></P>
<BLOCKQUOTE><IMG SRC="../../gx/dennis/bbub.gif" ALT="(!)"
HEIGHT="28" WIDTH="50" BORDER="0"
> [Heather]
Well, I don't know, but in the linux source tree under
/Documentation/networking/net-modules.txt several common options are
described for explicitly setting options such as I/O address rather than
allowing autoprobing. It also says that for many cards, explicitly stating
is better for them than autoprobing anyway. But the important part is it
directly addresses part of the question... namely, how one would use two
cards with the same driver, because at least under the 8390 family (cheap
old cards, such as ne2000):
</BLOCKQUOTE>
<BLOCKQUOTE><pre>
In many cases it is highly preferred that insmod:ing is done
ONLY with defining an explicit address for the card, AND BY
NOT USING AUTO-PROBING!
...
8390 based Network Modules (Paul Gortmaker, Nov 12, 1995)
--------------------------
(Includes: smc-ultra, ne, wd, 3c503, hp, hp-plus, e2100 and ac3200)
The 8390 series of network drivers now support multiple card systems without
reloading the same module multiple times (memory efficient!) This is done by
specifying multiple comma separated values, such as:
insmod 3c503.o io=0x280,0x300,0x330,0x350 xcvr=0,1,0,1
The above would have the one module controlling four 3c503 cards, with card 2
and 4 using external transceivers. The "insmod" manual describes the usage
of comma separated value lists.
It is *STRONGLY RECOMMENDED* that you supply "io=" instead of autoprobing.
If an "io=" argument is not supplied, then the ISA drivers will complain
about autoprobing being not recommended, and begrudgingly autoprobe for
a *SINGLE CARD ONLY* -- if you want to use multiple cards you *have* to
supply an "io=0xNNN,0xQQQ,..." argument.
</pre></BLOCKQUOTE>
<BLOCKQUOTE>
Therefore, I'm not certain, but it would be worth the experiment:
io=0xXXX,0xYYY and irq=X,Y parameters (where these X's and Y's represent
the values for each card respectively) should allow you to make it honor
two cards explicitly rather than autoprobing them. If you succeed at that,
try swapping card "X" and card "Y" in the settings and see if they switch
places in the ethN ring. And in any case you should be able to get the
right values for these from your logs, because you said you have the system
detecting all 3 cards.
</BLOCKQUOTE>
<BLOCKQUOTE>If they were really ISA cards with plug-n-play and/or jumpers,
the isapnptools would be the next place I'd look.
</BLOCKQUOTE>
<BLOCKQUOTE>I took the lazy route; I have a tulip and a 3com card in my
dual ethernet system. With it that way, I can even tell the system to not
even automatically bring these interfaces up, and explicitly bind the given
drivers into the pre-up and post-down, at least on debian. In SuSE I have
it mentioned in modules.conf:
</BLOCKQUOTE>
<BLOCKQUOTE><pre>
alias eth0 3c59x
alias eth1 tulip
</pre></BLOCKQUOTE>
<!-- sig -->
<!-- sig -->
<!-- end 1 -->
<!--startcut ======================================================= -->
<P> <hr> </p>
<!-- *** BEGIN copyright *** -->
<H5 align="center">This page edited and maintained by the Editors
of <I>Linux Gazette</I>
<a href="http://www.linuxgazette.com/copying.html"
>Copyright &copy;</a> 2001
<BR>Published in issue 62 of <I>Linux Gazette</I> February 2001</H5>
<H6 ALIGN="center">HTML script maintained by
<A HREF="mailto:star@starshine.org">Heather Stern</a> of
Starshine Technical Services,
<A HREF="http://www.starshine.org/">http://www.starshine.org/</A>
</H6>
<!-- *** END copyright *** -->
<P> <hr>
<!-- begin tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::-->
<p align="center">
<table width="100%" border="0"><tr>
<td align="right" valign="center"
><IMG ALT="" SRC="../../gx/navbar/left.jpg"
WIDTH="14" HEIGHT="45" BORDER="0" ALIGN="middle" border="0">
<A HREF="../lg_answer62.html"
><IMG SRC="../../gx/dennis/answertoc.jpg" align="middle"
ALT="[ Answer Guy Current Index ]" border="0"></A></td>
<td align="center" valign="center"><A HREF="../lg_answer62.html#greeting"><img align="middle"
src="../../gx/dennis/smily.gif" alt="greetings" border="0"></A> &nbsp;
<A HREF="1.html">1</A> &nbsp;
<A HREF="2.html">2</A> &nbsp;
<A HREF="3.html">3</A> &nbsp;
<A HREF="4.html">4</A> &nbsp;
<A HREF="5.html">5</A> &nbsp;
<A HREF="6.html">6</A> &nbsp;
<A HREF="7.html">7</A></td>
<td align="left" valign="center"><A HREF="../../tag/kb.html"
><IMG SRC="../../gx/dennis/answerpast.jpg" align="middle"
ALT="[ Index of Past Answers ]" border="0"></A>
<IMG ALT="" SRC="../../gx/navbar/right.jpg" align="middle"
WIDTH="14" HEIGHT="45" BORDER="0"></td></tr></table>
</p>
<!-- end tagnav ::::::::::::::::::::::::::::::::::::::::::::::::::::-->
<P> <hr>
<CENTER>
<!-- *** BEGIN navbar *** -->
<!-- *** END navbar *** -->
</CENTER>
</p>
<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
</BODY></HTML>
<!--endcut ========================================================= -->