Solved

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

Posted on 2007-12-06
7
960 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 87

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 300 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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 200 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 300 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now