Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

15 ethernet interfaces, which is Eth0 ?  ( in linux )

Posted on 2007-12-06
7
Medium Priority
?
1,025 Views
Last Modified: 2010-04-21
We have stacked servers and the people that manage them are very very far away.  They need to plug into eth0 and the dell servers run Redhat 4.

Without plugging in all the interfaces, how can we determine which actuall nick ( or quad nic port ) is eth0

I need someone to be able to physicaly point to eth0  

How does linux deside which one is zero ?  
0
Comment
Question by:itguy411
7 Comments
 
LVL 88

Expert Comment

by:rindi
ID: 20423593
ifconfig eth0 will show you some info on the nic, including it's MAC address. From that you should be able to find out which one it is.
0
 
LVL 13

Expert Comment

by:WizRd-Linux
ID: 20423905
if ifplugd is running on the server and you can call the people that support the box you can be on the phone and plug in 1 interface, they should then be able to tell you by looking at /var/log/messages which interface has been plugged in, if it isn't the correct one move to the next one till they tell you eth0 is plugged in.

It would pay at that stage to create a list / map of the cards and label the interfaces.
0
 
LVL 8

Accepted Solution

by:
Rance_Hall earned 1200 total points
ID: 20424028
Linux assigns the ethX numbers in the order that the nics are detected at startup, this is influenced by two paramaters:

In order of importance:  the order that the network card modules are modprobed into the kernel at startup

a system with three nics might have nic 2 listed as eth0 if its module was the first one loaded, and thus its the first one detected.

If you have more that one nic in the system that takes the same module/driver then the order is the pci port order on the MB

a pci scan starts at pci slot 0 and works it way down the list.

so two identical cards will be numbered in the order that the bus was scanned.

so, combine those two items, and you have the ethX mystery pretty well solved.

so to recap, the order that the driver was loaded into the kernel, and the order of identical cards on the bus.

You can usually manipulate the module loading order by creating a modprobe.conf file, or something similar for your distro (check your docs for sure) and listing the modules in the order you want them loaded.

This can sometimes force eth0 to be the one you want.  (sometimes because the bus order thing you cant change)

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 12

Expert Comment

by:bhnmi
ID: 20424051
I have found more often then not (allot more then not), that the port furthest to the right is eth0.
0
 
LVL 1

Assisted Solution

by:manuelflury
manuelflury earned 800 total points
ID: 20427047
Use lspci to get the information from the PCI bus

The order the module are loaded determine the numbering

Finally type as root :

dmesg to get info from the kernel

You should get your answer :

$ dmesg | grep eth
divert: not allocating divert_blk for non-ethernet device lo
divert: allocating divert_blk for eth0
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
divert: allocating divert_blk for eth1
e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: eth0: e1000_watchdog_task: NIC Link is Up 100 Mbps Full Duplex
e1000: eth0: e1000_watchdog_task: 10/100 speed: disabling TSO
divert: not allocating divert_blk for non-ethernet device sit0
0
 
LVL 8

Assisted Solution

by:Rance_Hall
Rance_Hall earned 1200 total points
ID: 20427539
My first introduction to modules.conf was on a gentoo box.

Iif you change the order that the modules are loaded you get eth0 assigned to different nic.

as far as the furthest to the right, I think thats the MB pci slot order, but different MB makers can put them in another order if they want to.

This is one think that freebsd got right, when a kernel driver detects an ethernet card, the card is not given ethX as a name, its given a name that is related to the driver that is loaded to run the card.

so then you end up with vr0 and xl0 and whatever else.  its still in MB pci port order, but its alot nicer (IMO)







0
 

Author Closing Comment

by:itguy411
ID: 31413266
This was one of the best, accurate and total solutions I  have had on EE and I love EE.

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More or less everybody in the IT market understands the basics of Networking, however when we start talking about Storage Networks, things get a bit dizzier, and this is where I would like to help.
this article is a guided solution for most of the common server issues in server hardware tasks we are facing in our routine job works. the topics in the following article covered are, 1) dell hardware raidlevel (Perc) 2) adding HDD 3) how t…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question