[NTLUG:Discuss] which one is eth0, and which one is eth1?

Mark Bickel eusmb at exu.ericsson.se
Thu Jul 13 13:05:08 CDT 2000


jc wrote:

> From: "m m" <llliiilll at hotmail.com>
> Subject: [NTLUG:Discuss] which one is eth0, and which one is eth1?

> 1. How do I know which card is eth0 and the other is eth1 physically? I 
> guess that it is based on the motherboard's slot order? right?

Nope. The network devices are not "physical" devices - they are not represented
under /dev/. Rather, they are "logical" device names known to the kernel, and
they are logically assigned as they are recognized by the kernel. In most modern
Linux distros ethernet NIC drivers are not compiled directly into the kernel,
they are loaded as modules, so the order in which the modules are loaded for 
each NIC determines what its network device name is, not MB slot order, or even
necessarily the base I/O address of the card, although on systems which are 
configured to autoprobe for network hardware, they *may* detect the lowest base
I/O address NIC first and automaticly load the module for it, thereby assigning
it to be "eth0", and then the next NIC detected would be assigned "eth1", etc.

Note that if you have two "identical" NICs in the system, they still must have
unique I/O addresses and probably unique IRQs and possibly even unique DMA
channels as well. Thus, even if both NICs use the same type module (driver),
a unique instance must be loaded for each NIC, each with its own parameters.

Try looking at /etc/modules.conf (or some such, depending on your distro) to
see the order in which your modules are being loaded, and with what parameters.
 
> 2. when I type ifconfig, it only shown the information of lo and eth0, but 
> if I type ifconfig eth1, it will show eth1’s information? What is wrong on 
> it?

Nothing. If eth1 is not bound to an IP address and is not "up" it will not show
up under "ifconfig" unless the interface name is declared, as in "ifconfig eth1".
Try this: "ifconfig eth1 up", then "ifconfig" - voila! eth1 shows up now, although
it probably has no IP address bound to it. If you bind an IP address to eth1 it
will show up under "ifconfig". You could manually bind the interface thus:
"ifconfig eth1 192.168.2.1 netmask 255.255.255.0"

man lsmod
man modinfo
man modprobe
man insmod
man ifconfig
man dhcpcd
man route

There! That should give you a big clue as to what's really happening
under the hood. Of course you can use a GUI sysem admin and config tool
like linuxconf (various distros), conftool (redhat), Yast (SuSE) or 
coas or lisa or webmin (all for/from Caldera) to configure your network
interfaces, but if they don't work ...

Mark.Bickel at ericsson.com




More information about the Discuss mailing list